Using AI to Improve Test Efficiency: A Practical Example of Automated Test Case Generation

Software testing is a critical part of the software development process, ensuring that the application meets the requirements and functions as intended. However, the traditional manual test case generation process can be time-consuming, and tedious, and may not cover all possible scenarios. This is where AI comes in, automating the test case generation process and improving efficiency. In this article, we will explore a practical example of how AI can be used to generate test cases automatically, improving test efficiency.

Example Scenario:

Imagine we have a web-based e-commerce application that enables users to search for and purchase products. The application has several features, including user registration, product search, product details, and checkout. A team of developers is working on the application, and a team of testers is responsible for ensuring that the application works as expected and meets the requirements.

Manual Test Case Generation:

Traditionally, testers create test cases manually based on their knowledge of the application and the requirements. For our example e-commerce application, testers would need to create test cases to cover each functionality, such as registering a user, searching for a product, viewing product details, and placing an order. The test cases would need to cover different scenarios, such as valid and invalid inputs, error handling, and boundary conditions.

Automated Test Case Generation:

However, with AI, we can automate the test case generation process by using machine learning algorithms to analyze the application code and generate test cases automatically. In this example, we will use an open-source tool called “AutoTestGen,” which is based on machine learning algorithms.

AutoTestGen works by analyzing the code of the application and generating test cases to cover all possible paths and branches. The tool can generate test cases for various programming languages, including Java, C++, and Python. To use AutoTestGen for our e-commerce application, we would provide the source code to the tool and run it. The tool would then analyze the code and generate test cases automatically, covering all possible paths and branches.

Comparison:

To compare the results obtained using manual test case generation versus AI-based test case generation, we can measure the time and coverage. Manual test case generation is time-consuming and may not cover all possible scenarios. AI-based test case generation, on the other hand, is faster and more comprehensive, covering all possible paths and branches.

Conclusion:

Automated test case generation using AI can significantly improve test efficiency by automating the tedious and time-consuming process of manual test case generation. It can also improve the coverage of test cases by covering all possible paths and branches. Open-source tools such as AutoTestGen can be used to automate the test case generation process, improving test efficiency, and ensuring better software quality. With the help of AI, software development teams can save time, reduce costs, and improve their testing process, ultimately leading to better software quality and user experience.

If you’re interested in learning more about how AI can improve software test efficiency or want to consult with me to help introduce AI to your testing teams, please feel free to reach out to me at askabk@abkhalid.com . Together, we can explore how AI can transform the way we test software and help us deliver high-quality products faster and more efficiently.

Hey, What do you call a group of programmers in a bar?

A stack overflow

You need to add a widget, row, or prebuilt layout before you’ll see anything here. 🙂

Why only Load Runner is not enough for Performance Testing

I just got email form my manger (she is a bit blog enthusiast) that I have stopped writing blogs. The thing is at Kualitatem, we encourage our resources to learn and/or share their experiences. I played the usual busy card, but later on her persuasion, here I am.

This topic I have been having in my mind for more than 6 months. And I not so called ‘performance tester’ was not able to get the proper answer from anybody. Question was, “Is load runner able to give you the actual picture on its own”. Well simple answer is, “If you are a guru, then it gives you fair idea of the whole situation, but no, it’s not possible”. (To let you on a secret, my ego was hurt by couple of load runner projects, which made me sit up and take notice, before that I always thought load testing as alien for myself, a test management resource.)

I will try to explain below why only load runner is not enough for performance testing, below.

Load runner is a tool for performance monitoring. It is able to tell you, what is application’s behavior, at what time under how much load. But it will not be able to tell you what was the origin of the problem and was this problem even problem, or mare hardware configuration issues. (Even load runner itself says that it is able to only provide 10% of actual diagnostics information.)

After exploring more, and doing some experiments, I came to know load runner is not been able to tell me

  • What was the condition of hardware before and after load test
  • What was the area causing the problem
  • What other application area are suffering due to this load
  • Is there a way to improve (clue, people say that you only need to look at page load to understand performance of application, well my answer now is HELL NO!)

So we have identified the main problems, we need to find the solution for it.

My research led me to the solution, and believe you me, the solutions was always there, we (or Ancient Performance Testers) only chose to let us believe we only have Load Runner, so coming back to solution, it’s simple, we need to use more tools for Performance Testing together with different scopes in order to establish better results from performance testing, and HP is already providing them by name of HP Diagnostics and HP Site Scope.

Well Site scope is tool basically monitor the all aspects of IT infrastructure (in words of HP, “Remote monitoring of IT infrastructure and applications without installing any software on target systems”) while name of diagnostics clearly indicates its function, which is to deliver to you actual problem at any given point of time, and helps you in targeting them (in words of HP, “Remote monitoring of IT infrastructure and applications without installing any software on target systems”).

Now again the problem is to know at which point of time, what is right information. So consider following chart

  • Site scope will give you information of hardware and software for 24/7, when script is being executed, before it and after it.
  • Diagnostics will tell you what is the current state of application, which function is using how much resources, and what has left stones unturned
  • Loadrunner will execute the scenario, and tell you what is the situation form user point of view during that scenario

So by combining the results from all three, we will be able to identify the situation before the issue was occurred, what occurred that issue, and from where we can resolve it.

In my next blogs, I will try to help you set up performance testing environment, as I believe is the correct way.

Topics are

  1. HP Diagnostics introduction
  2. Setting up Diagnostics Commander Server
  3. Setting up Diagnostics Mediator Server
  4. Setting up Diagnostics Java Probe with Tomcat
  5. Setting up Diagnostics Java Probe with JBOSS
  6. Setting up Diagnostics .NEt Probe
  7. HP Sitescope Introduction
  8. Setting up Sitescope monitors
  9. Configuration of HP Diagnostics and HP Site Scope with HP Load Runner

SSL Support with JBOSS (HP QC/ALM)

During one of our recent implementation of HP Quality Center, one representative form the client, kept asking me, Ahmad! “Why you are not implementing SSL. We have very secure data and you are exposing it”.

Defiantly I had to look at it as refusing clients, is not part of our company policy.

After working at it for couple of days, I came up with following solution (Got little help from HP Support Community).

Step 1: Install HP Quality Center with JBoss Application Server

Step 2: In command prompt navigate to Java Bin Directory (JRE – Install it if not present).

Default Directory can be <installation drive>\Program Files\HP\<Either of Quality Center or Application Life Cycle Management>\Java\JRE\bin\

Step 3: Run following commands (in place of “Server Name” write the actual server name)

  1. set SERVER_DN=”CN=<server name>, OU=X, O=Y, L=Z, S=XY, C=YZ”
  2. set CLIENT_DN=”CN=Client, OU=X, O=Y, L=Z, S=XY, C=YZ”
  3. set KSDEFAULTS=-storepass changeit
  4. set KEYINFO=-keyalg RSA
  5. keytool -genkey -alias tomcat -dname %SERVER_DN% %KSDEFAULTS% -keystore server.keystore %KEYINFO% -keypass changeit
  6. keytool -export -alias tomcat -file temp_server.cer %KSDEFAULTS% -keystore server.keystore
  7. keytool -import -v -trustcacerts -alias tomcat -file temp_server.cer %KSDEFAULTS% -keystore client.keystore.trust -keypass changeit

Step 4: Take copy of CACERTS file present in the <installation drive>\Program Files\HP\<Either of Quality Center or Application Life Cycle Management>\Java\JRE\lib\security and place it somewhere safe

Step 5: Copy the file created by Step 3 Part 7 (CLIENT.KEYSTORE.TRUST) and to the <installation drive>\Program Files\HP\<Either of Quality Center or Application Life Cycle Management>\Java\JRE\lib\security folder and rename it CACERTS

Step 6: Copy the file created by Step 3 Part 6 (SERVER.KEYSTORE) to an accessible location like C:\CAs\server.keystore

Step 7: Back up “server.xml” present in <installation Drive>\ Program Files\HP\<Either of Quality Center or Application Life Cycle Management>\jboss\jboss.zip\server\default\deploy\jbossweb.sar

Step 8: Edit the “server.xml” by Uncommenting the SSL connector, edit the keystoreFile and keystorePass options:

<!– SSL/TLS Connector configuration using the admin devl guide keystore –> <Connector port=”8443″ address=”${jboss.bind.address}” maxThreads=”100″ minSpareThreads=”5″ maxSpareThreads=”15″ scheme=”https” secure=”true” clientAuth=”false” keystoreFile=”C:\CAs\server.keystore” keystorePass=”changeit” sslProtocol=”TLS” />

Comment out the HTTP connector in the server.xml file.

Step 9:             Save the server.xml file, and restart JBoss and QC (e.g., via the Windows Services)

Step 10: Connect to QC using port 8443. Forexample (https://server name:8443/qcbin)

Myth about Skill Required for Automation Testing

My recent observations of SQA Skills trends in Pakistan in particular and overall in general, a tendency to ask people being hired for SQA positions if they have experience, skills or knowledge of automation testing. And the answer the hiring body is mostly looking for is if they have working experience of QTP, Selenium or RFT. If the resource says he is willing to learn QTP or Selenium or RFT or whatever, people start teaching them these tools.

I have started to get frustrated by this behavior, but I also have been part of this culture too, so one can say I am frustrated with myself too.

Let me quote you one story, one person who was well-versed in Software Quality Management in early 2000(s); advertised following skills for QA resources, job advertised with title Software Developer and Quality Analyst

  • ISO
  • Development (language not important)
  • Automata
  • Data Communication and Networks
  • Regular Expressions
  • Critical Eye

After experience of hiring, getting hired, working and managing teams, I have to come to know that above ad was the best possible ad for what we mostly look from our resource.

But are we looking at right skill set, or even we know what we want, I think about 90% people don’t know the answer, and the ones that know hide behind ‘budget limitation’ wall.

I believe we should look at software automation testing as we look at software development; we need at least two type of personal, one Software Automation Script Developer and one Software Automation Engineer.

Software Automation Engineer: Should be the person, who has application domain knowledge, has written the Test Cases for the application, and understands which area of application needs regression. He also understands and can write suede code, which a developer can understand and convert to physical code. He is also going to prepare the data for the data driven automation testing.

Software Automation Script Developer: Should be the person who gets the test case in document form, and just creates the script as defined. He has the understanding of the scripting language.

I will try to explain in detail what these roles should comprehend in grand scheme of Software Quality Assurance in the long run.

Translate »