当前位置:网站首页>Do you know the advantages and disadvantages of several open source automated testing frameworks?

Do you know the advantages and disadvantages of several open source automated testing frameworks?

2022-07-06 15:13:00 Test Xiaowan

Catalog

1. Robot Framework

2. JUnit

 3. Spock 

4. NUnit

 ​5. TestNG

6. Jasmin

7. Mocha


1. Robot Framework


Robot Framework(RF) Is used for acceptance testing and acceptance test driven development (ATDD) Automatic testing framework of . be based on Python To write , But it can also be in Jython(Java) and IronPython(.NET) Up operation , Provide cross platform support (Windows、Linux or MacOS ).
advantage :

  • By using keywords to drive tests (KDT) The method simplifies the automatic testing process , Easy for testers to create readable tests .
  • The test data syntax is simple and easy to use .
  • The ecosystem is rich . It consists of various general test libraries and tools , These tools were developed as independent projects .
  • Highly scalable .
  • It can be done by  pabot  or  Selenium Grid  Execute parallel tests .

shortcoming :

  • Customize HTML The report is troublesome .

If it is for a wide range of libraries and extensions KDT automated testing , It is recommended to use this cross platform framework . If you want to add new keywords ( adopt  RF Test library API ), Need to have Java / Python / C Basic knowledge of language .

 

2. JUnit


JUnit It's about Java Unit test framework of application , For writing and running repeatable tests .
advantage :

  • pure Java To write .
  • Support Test Driven Development (TDD).
  • Allow to create your own unit test case suite .
  • Can work well with other tools ( Such as Maven ) and IDE( Such as IntelliJ ) Integrate .
  • Long term development , It has its own huge user group , Documents can be easily found .

shortcoming :

  • if necessary mocking Ability , Additional  Mockito( Or other simulation libraries ).
  • because JUnit Method names in are affected by Java Agreed restrictions and other reasons , It is difficult for non-technical personnel to understand the test results .

If you are working for your Java Application writing unit tests , Then this may be the best choice . however , For functional testing or non Java application , Other solutions should be considered .

                
3. Spock 


Spock Is used for Java and Groovy Applied testing and specification framework , be based on JUnit .
advantage :

  • The test is readable , Support simple English sentences , Easy to read .
  • Provide surrounding context , Thus, it is easy to understand how to solve the fault .
  • built-in mocking and stubbing function .
  • Support data-driven testing (DDT).

shortcoming :

  • You need to have basic Groovy language knowledge .

If your application is based on JVM Of , And the goal is to use DSL Conduct BDD automated testing , Then this framework is suitable for !


4. NUnit


NUnit It supports all .Net The language's unit testing framework . It was originally based on Junit Inspired by the , Full adoption C# To write , It has been completely redesigned to use more .NET Language function .
advantage :

  • Fast startup and test execution .
  • With assertions and comments .
  • Support for parallel testing .
  • Support Test Driven Development (TDD).

shortcoming :

  • Non cross platform , Only applicable to .Net Language .
  • Not integrated into Visual Studio echo In the system , It means that using it requires more maintenance .

A good one C# Open source unit testing framework , Has a long history , High reputation . however , If you are ready to use .NET Language , You can also consider MSTest .

                        
5. TestNG

 
TestNG It's a Java Automated testing framework , suffer JUnit and NUnit Inspired by the , But some functions have been improved and added . Designed to cover all automated test categories : unit testing 、 A functional test 、 End to end 、 Integration testing, etc .
advantage :

  • Easy to integrate into maven In circulation .
  • Enable developers to write flexible and powerful tests .
  • Support data-driven testing (DDT).
  • Notes are easy to understand .
  • Test cases can be easily grouped .
  • Allow the creation of parallel tests .

shortcoming :

  • Only support Java , At least you need to have Java Basic knowledge of programming language .
  • Time must be invested in framework setting and design .

If you use Java , And is looking for an end-to-end automated testing framework , At the same time, I am willing to invest a little time in setting the framework , You should consider using TestNG .


6. Jasmin


Jasmine It's a JavaScript Unit test framework , Also known as JavaScript Behavior driven development (BDD) The test framework . For web pages 、Node.js Project or anything that can run JavaScript The place of . It is mainly related to AngularJS Pairs using .
advantage :

  • except JavaScript , It can also run in Python and Ruby in . If you want to run client tests on your server , It can help you .
  • By many CIs Use and support .
  • Built in syntax for assertions .

shortcoming :

  • Most of the time , It requires a test runner ( Such as Karma ).
  • Difficult to test asynchronously .

If you are looking for a unified ( client - The server ) Unit testing solutions ,Jasmin May be very suitable .


7. Mocha


Mocha It's a JavaScript Unit test framework , It's in NodeJs Run tests on , Mainly with ReactJS Pairs using .
advantage :

  • Built in test runner .
  • Support asynchronous testing .
  • Flexible use , You can use any assertion library that meets your needs (Chai、expect.js、Must.js etc. ) As Node standard “ Assertion ” A functional alternative .

shortcoming :

  • Relatively new ( From 2012 year ), It means that there are many unknowns and variability , In some aspects, it may lack user base and support .
    Only basic test structures are provided , Therefore, additional settings and configurations are required ( It may be beneficial for some ).

If you're looking for JavaScript Independent unit testing framework ,Mocha First choice !

Thank everyone who reads my article carefully !!!

If you can use the following information, you can take it away directly :

1、 Self study development or test the necessary complete project source code and environment

2、 Test all templates in the work ( test plan 、 The test case 、 Test report, etc )

3、 Classic interview questions for software testing

4、Python/Java Automation test practice .pdf

5、Jmeter/postman Interface test full set of video acquisition

I personally sorted out some technical materials I have sorted out in my software testing career in recent years , contain : e-book , Resume module , Various work templates , Interview treasure , Self study projects, etc . Please find me in the comment area if you need it. Thank you .

 

原网站

版权声明
本文为[Test Xiaowan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060919128708.html