# US 2008/0307264 A1 · Parameterized test driven development

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0307264 A1
- Document ID: US20080307264A1
- Status: Published application
- Kind: A1
- Application number: 11/759,144
- Filed: 2007-06-06
- Published: 2008-12-11
- Earliest claimed: 2007-06-06
- Assignees: Microsoft Corporation
- Inventors: Jonathan Paul de Halleux; Nikolai Tillmann; Wolfram Schulte
- Web page: https://patentgrep.com/patent/US20080307264A1

## CPC

- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

In one embodiment a computer system automatically generates unit tests. The computer system accesses a parameterized unit test that provides a base outline from which one or more unit tests are automatically generated, generates input parameter values for a unit of software code, automatically generates a unit test configured to assess the functionality of the unit of software code, and receives test results from a software testing program and provides feedback to a user. In other embodiments, a computer system automatically maintains a unit test database. The computer system receives a unit test at a unit test database, assigns a test identity to the received unit test, determines that the test identity assigned to the received unit test is unique when compared to other unit tests, determines that the received unit test has different functionality coverage characteristics, and adds the received unit test to the unit test database.

## Claims

### Claim 1

At a computer system, a method for automatically generating unit tests by instantiating one or more generated input parameter values, the unit tests being derived from a corresponding parameterized unit test, the method comprising:
an act of accessing a parameterized unit test configured to provide a base outline from which one or more unit tests are automatically generated;
an act of generating input parameter values for a unit of software code that is to be tested;
an act of automatically generating a unit test configured to assess the functionality of the unit of software code by instantiating one or more generated input parameter values, the generated input parameter values indicating parameters in which the unit of software code is to be tested, the generated input values corresponding to the unit of software code;
an act of receiving test results from a software testing program, the test results including a test results status; and
an act of providing feedback to a user, the feedback indicating at least the test results status.

### Claim 2 (depends on 1)

The method of claim 1, further comprising generating the generated input parameter values for the parameterized unit test using symbolic execution.

### Claim 3 (depends on 1)

The method of claim 1, further comprising generating the generated input parameter values for the parameterized unit test using pairwise combinatorial techniques.

### Claim 4 (depends on 1)

The method of claim 1, wherein the feedback comprises code suggestions that indicate how to fix a detected error.

### Claim 5 (depends on 4)

The method of claim 4, wherein the feedback is presented as an in-line hint in the software code.

### Claim 6 (depends on 4)

The method of claim 4, wherein the code suggestions that indicate how to fix a detected error are automatically applied to the software code unit.

### Claim 7 (depends on 6)

The method of claim 6, further comprising automatically retesting the software code unit with the automatically applied code fix suggestions.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
an act of determining that the received test results indicate that a desired level of test quality was reached; and
based on the determination, an act of generating a new unit test.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
an act of determining that the received test results indicate that a desired level of test quality was not reached; and
based on the determination, an act of revising the software code unit such that a subsequent test of the software code unit yields the desired level of test quality.

### Claim 10 (depends on 1)

The method of claim 1, wherein the base outline comprises one or more software functions that are to be tested.

### Claim 11

At a computer system with a unit test database configured to store unit tests, a method for automatically maintaining the unit test database, the method comprising:
an act of receiving a unit test at a unit test database;
an act of assigning a test identity to the received unit test, the test identity based on at least one of the unit test software code, unit test covered functionality and the identity of the parameterized unit test from which the received unit test was derived;
an act of determining that the test identity assigned to the received unit test is unique when compared to other unit tests in the unit test database;
upon determining that the received unit test is unique in the unit test database, an act of determining that the received unit test has different functionality coverage characteristics than other unit tests in the unit test database; and
upon the determining that the received unit test has different functionality coverage characteristics, an act of adding the received unit test to the unit test database.

### Claim 12 (depends on 11)

The method of claim 11, wherein the act of determining that the received unit test has different functionality coverage characteristics than other unit tests in the unit test database comprises determining that the unit test provides functionally different results.

### Claim 13 (depends on 11)

The method of claim 11, further comprising, upon determining that the received unit test has different functionality coverage characteristics than other unit tests in the unit test database, an act of updating an existing unit test with the different functionality coverage characteristics.

### Claim 14 (depends on 11)

The method of claim 11, further comprising:
an act of determining that the test identity assigned to the received unit test is not unique; and
based on the determination, an act of deleting the received unit test.

### Claim 15 (depends on 11)

The method of claim 11, wherein the functionality coverage comprises code coverage.

### Claim 16 (depends on 11)

The method of claim 11, wherein the functionality coverage comprises branch coverage.

### Claim 17

At a computer system with a unit test database configured to store unit tests, a method for automatically maintaining the unit test database, the method comprising:
an act of receiving a unit test at a unit test database;
an act of assigning a test identity to the received unit test, the test identity based on at least one of the unit test software code, unit test covered functionality and the identity of the parameterized unit test from which the received unit test was derived;
an act of determining that the test identity assigned to the received unit test is unique when compared to other unit tests in the unit test database;
upon determining that the received unit test is unique in the unit test database, an act of determining that even though the test identity assigned to the received unit test is unique, the received unit test has fully overlapping functionality coverage characteristics as compared to other unit tests in the unit test database; and
upon the determining that the received unit test has fully overlapping functionality coverage characteristics, an act of deleting the received unit test from the unit test database.

### Claim 18 (depends on 17)

The method of claim 17, wherein the act of determining that the received unit test has fully overlapping functionality coverage characteristics as compared to other unit tests in the unit test database comprises determining that the unit test provides functionally similar test results.

### Claim 19 (depends on 17)

The method of claim 17, further comprising:
an act of determining that the test identity assigned to the received unit test is not unique; and
based on the determination, an act of deleting the received unit test.

### Claim 20 (depends on 17)

The method of claim 17, wherein the unit test database is divided into one or more portions for categorizing unit tests based on the time of creation.
