StubCoder: Automated Generation and Repair of Stub Code for Mock Objects

07/27/2023
by   Hengcheng Zhu, et al.
0

Mocking is an essential unit testing technique for isolating the class under test (CUT) from its dependencies. Developers often leverage mocking frameworks to develop stub code that specifies the behaviors of mock objects. However, developing and maintaining stub code is labor-intensive and error-prone. In this paper, we present StubCoder to automatically generate and repair stub code for regression testing. StubCoder implements a novel evolutionary algorithm that synthesizes test-passing stub code guided by the runtime behavior of test cases. We evaluated our proposed approach on 59 test cases from 13 open-source projects. Our evaluation results show that StubCoder can effectively generate stub code for incomplete test cases without stub code and repair obsolete test cases with broken stub code.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/22/2020

EPiT : A Software Testing Tool for Generation of Test Cases Automatically

Software test cases can be defined as a set of condition where a tester ...
research
01/12/2019

EvoMaster: Evolutionary Multi-context Automated System Test Generation

This paper presents EvoMaster, an open-source tool that is able to autom...
research
03/07/2023

Do the Test Smells Assertion Roulette and Eager Test Impact Students' Troubleshooting and Debugging Capabilities?

To ensure the quality of a software system, developers perform an activi...
research
09/21/2022

PTSG: a test generation tool based on extended finite state machine

The Extended Finite State Machine (EFSM) is one of the most popular mode...
research
10/15/2018

Finding a boundary between valid and invalid regions of the input space

In the context of robustness testing, the boundary between the valid and...
research
12/10/2019

Search-based Crash Reproduction using Behavioral Model Seeding

Search-based crash reproduction approaches assist developers during debu...
research
10/06/2019

Automated Isolation for White-box Test Generation

Context. White-box test generation is a technique used for automatically...

Please sign up or login with your details

Forgot password? Click here to reset