BACKGROUND

Technical Field

The present invention relates to automated software testing and more particularly automated test case design and implementation.

Description of the Related Art

Testing is an important phase in the life cycle of a computer project and test design is an important aspect of the testing phase. Software testing assures product quality, customer satisfaction, and security. In testing computer programs and code, a tester chooses inputs to exercise paths through the code and determine whether the outputs were expected. The goal of testing design is to prepare code tests that discover system faults or bugs as early as possible, and at the same time achieve the maximum code coverage. Test cases can be designed and prepared to test the inputs and verify the output of the software program and/or computer system. Each entry and exit point of a subprogram may be exercised. Testing case selection and prioritization can be one of the most important parts of testing case design. Code testing can miss parts of the computer code or be redundant with other test cases, so it is paramount that the right test cases are selected to test as much code and as many input and output scenarios, as possible, effectively and efficiently because there is limited time and resources for code testing.

White-box testing is a method of testing the software applications at the level of the source code.

SUMMARY

According to an aspect of the present invention, a computer implemented method for automated software test design and implementation is provided. The method includes establishing an initial pool of test cases for testing computer code; applying the initial pool of test cases to the computer code in a testing environment to generate test results; preprocessing the test results into a predetermined format; extracting metadata from the test results; generating a training sequence; calculating a reward value, r, for the pool of test cases; inputting the training sequence and reward value into a reinforcement learning agent; utilizing the value output from the reinforcement learning agent to produce a ranking list, prioritizing the initial pool of test cases and one or more new test cases based on the ranking list, and applying the prioritized initial pool of test cases and one or more new test cases to the computer code in a testing environment to generate test results.

According to another aspect of the present invention, a system is provided for automated software test design and implementation. The system includes a computer system including random access memory configured to store an automated software test design and implementation system; one or more processor devices and an operating system; and a database configured to store an initial pool of test cases, wherein the automated software test design and implementation system. The automated software test design and implementation system includes a tester configured to applying the initial pool of test cases to computer code to be tested in a testing environment to generate test results; a preprocessor configured to preprocess the test results into a predetermined format; an extractor configured to extract metadata from the test results; a sequence generator configured to generate a training sequence; a reward generator configured to calculate a reward value, r, for the pool of test cases; a learning agent configured to receive the training sequence and reward value and output a vector value; and a selector configured to utilize the vector value output from the reinforcement learning agent to produce a ranking list, prioritize the initial pool of test cases and one or more new test cases based on the ranking list, and apply the prioritized initial pool of test cases and one or more new test cases to the computer code in a testing environment to generate test results.

According to another aspect of the present invention, a non-transitory computer readable storage medium having a computer readable program for a computer implemented automated software test design and implementation is provided. The computer readable program when executed on a computer causes the computer to perform establishing an initial pool of test cases for testing computer code; applying the initial pool of test cases to the computer code in a testing environment to generate test results; preprocessing the test results into a predetermined format; extracting metadata from the test results; generating a training sequence; calculating a reward value for the pool of test cases; inputting the training sequence and reward value, r, into a reinforcement learning agent; utilizing the value output from the reinforcement learning agent to produce a ranking list; prioritizing the initial pool of test cases and one or more new test cases based on the ranking list; and applying the prioritized initial pool of test cases and one or more new test cases to the computer code in a testing environment to generate test results.

These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.

