Font Size: a A A

The Design And Implementation Of An Online Test Development System Based On Homologous Code Matching

Posted on:2021-04-09Degree:MasterType:Thesis
Country:ChinaCandidate:Y Y YuanFull Text:PDF
GTID:2428330647950877Subject:Engineering
Abstract/Summary:PDF Full Text Request
With the penetration of software into life,people's requirements for correctness and stability are increasing,and software testing is becoming more and more important.But there are still many developers who lack basic testing skills.Some novices don't even know how to write a test case.Some beginners may be able to develop simple tests,but it is difficult for them to achieve the required standards in functional coverage.Therefore,many test automation generation tools were born to assist test development.However,the existing tools often have some problems such as complicated configuration,time-consuming,unintuitive source code coverage,and large test cases volume that is difficult to read.Test generation methods with high usablity,fast feedback,intuitive coverage,and readable use cases will be more helpful to cover the target function points,while improving the developers' test ability.This article relies on Mooc Test Web IDE to design and implement an online test development system based on homologous code matching.Use the LSP protocol to add multi-language intelligent code prompts.Combine Open Clover to achieve test coverage visualization.At the same time,a test automation generation scheme is proposed.First,collect historical data of open source websites and examination platforms to build a corpus of test codes;Then,use program analysis technology to extract the structure and text information of the code under test;After,based on string matching,spelling correction,near-sense search,program similarity analysis and other means to measure homology;Finally,the test cases of the homologous method in the library are searched and modified,and concise and usable test code for the method to be tested is generated.For projects that are not covered by the corpus,the system integrates the optimized Evosuite tool to provide users with basic test cases for the target method.The system mainly includes service modules such as intelligent prompt,coverage visualization,homologous code matching and test generation.The services communicate with each other through Restful API and Web Socket.Use Nginx for horizontal expansion,combined with NAS storage to achieve data sharing and statelessness between servers.To ensure the portability of services,Docker is used for packaging and deployment.With Elastic Search used for corpus storage,improve matching and retrieval efficiency.Use caching and multi-threaded concurrent technology to speed up the response speed of the server end.This article tests and evaluates the effectiveness of the system.Test statistics found that the system reduced the average processing time of a single project from 65 s to 20 s,and the throughput was greatly improved.Application experiments confirmed that the system can help users to gradually increase test coverage.Comparative experiments show that,compared to the signature matching algorithm,The homology matching algorithm can generate more test cases for more project methods,and the accuracy rate is more than 90%.In summary,the system can quickly and effectively help testers write basic test cases.While improving the coverage of source code,it is concise enough for testers to read and learn.
Keywords/Search Tags:Intelligent Prompt, Homologous Code Matching, Test Automation Generation, Online Programming
PDF Full Text Request
Related items