Browse Prior Art Database

Method and System for Automatically Creating Unit Tests

IP.com Disclosure Number: IPCOM000250287D
Publication Date: 2017-Jun-21
Document File: 2 page(s) / 34K

Publishing Venue

The IP.com Prior Art Database

Abstract

A method and system is disclosed for automatically creating unit tests by utilizing program execution breakpoints in order to capture a desired input and an output state in a sample run of a program. The method and system, then, generates a unit test class from the captured information.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Method and System for Automatically Creating Unit Tests

A method and system is disclosed for automatically creating unit tests by utilizing program execution breakpoints in order to capture a desired input and an output state in a sample run of a program. The method and system, then, generates a unit test class from the captured information.

In existing techniques, software developers manually create unit tests, which can be very time consuming, error prone and is a difficult process when dealing with complex data types.

Therefore, there exists a need for a method and system that automatically creates unit tests.

Disclosed is a method and system for automatically creating unit tests by utilizing program execution breakpoints in order to capture a desired input and an output state in a sample run of a program. The method and system, then, generates a unit test class from the captured information.

The Figure below illustrates the process steps of creating unit tests by utilizing program execution breakpoints in order to capture a desired input and an output state in a sample run of a program in accordance with an embodiment.

Figure

As illustrated in the Figure, the method and system accepts a call site or is provided sufficient information to derive a desired call location (possibly at runtime). For

example, a user may specify a function that the user may want to make a unit test on. The method and system, then, utilizes an instance where the function is called. Additional information may be provided to further specify the desired call if another call is preferred

Additionally, the user defines a part of the state necessary for the input and the output. For example, the user defines arguments to a given function and two global variables as the input and a function's return value as the output. Further, the method and system is directed to both a source code and a corresponding executable.

In addition, the method and system creates two breakpoints based on the specified function call, one for the function's entry and another for the function’s return. Consequently, the method and system runs the executable until the first breakpoint is hit, wherein at t...