Research on aided generation technology of Mock in software testing
DOI:
Author:
Affiliation:

Clc Number:

TP311.5, TN06

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    Mock technology plays an important role in improving the independence and comprehensiveness of software unit testing. The existing Mock generation framework needs to write the logic of Mock method manually, which leads to heavy workload and possibly introduce human errors. In view of the low efficiency of Mock method construction in testing, an aided generation method of Mock based on data driven idea is proposed, which defines the Mock model to describe internal logic of the implementation, so that the input and output data are independent of the test script. Firstly, through the analysis of programs under test, the simulated method and its input and output parameters are found and analyzed. Secondly, the input and output relationship is modeled. Thirdly, the Mock method is generated for the simulated method based on the input and output relation. Finally, the simulated method in programs under test is replaced by the Mock method. The effectiveness of the proposed method is proved by experiments.

    Reference
    Related
    Cited by
Get Citation
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:
  • Revised:
  • Adopted:
  • Online: August 03,2021
  • Published: