Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Acceptance Test-driven Development based on Robot Framework

2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

A-TDD (Acceptance test-driven development) with Robot framework

Before you learn about A-TTD, take a look at TTD.

Test-driven development, the English full name Test-Driven Development, referred to as TDD, is a new development method which is different from the traditional software development process. It requires that before writing the code of a function, write the test code, and then only write the function code that makes the test pass, through the test to promote the whole development. This helps to write concise, available and high-quality code and speed up the development process.

A-TTD (acceptance Test driven Development) is very close to T-DD. The difference is that A-TDD emphasizes development-test-customer collaboration. A-TTD is a collaborative requirements discovery method that uses examples and automated tests to identify requirements and create executable use case methods.

ATTD (acceptance Test driven Development) is a common practice in Agile and scrum. The block diagram is as follows:

1. Discuss the requirement in a workshop (discuss requirements in symposiums)

2. Develop them concurrently during the iteration (parallel development in iteration)

3. Deliver the result to the stakeholder for acceptance. (submit the results to stakeholders for acceptance)

Discuss (discussion):

Paticipants: product owner, related stakeholder, developer

How to discuss: the illusion that the system is complete, how you will use the system and what you expect it to achieve.

The focus of the workshop is to discuss and identify requirements rather than actual testing.

Develop (Development):

Extract the sample into a test.

Development of requirements implementation activities (including test libraries,tables)

The implementation requirements passed the test.

Deliver (delivery):

When the test passes, the requirements are reviewed by the product owner and other stakeholders, which may lead to new requirements or changes to existing tests

The following figure is a more detailed A-TDD framework diagram

How to map to Scrum by A-TDD.

Discussion: teams, product owners, and stakeholders need to clarify requirements in a symposium prior to a specific Sprint plan.

Parallel development: in the process of iteration, the development of requirements is realized, and the testing of verification implementation needs to be planned in sprint backlog.

Delivery acceptance: deliver the case of requirements-based products and acceptance tests to stakeholders and organize Sprint review discussions.

A-TDD example demonstration (ATTD with Robot Framework)

Robot background: Robot Framework is a keyword-driven automated testing framework. For specific information, see

Www.robotframework.org

There is an information query system for supplier fairs, through which visitors can use it to query the following information:

Where can I find the booth of supplier X?

How can I get to that place?

Where is the nearest restaurant?

Other visitors' comments on the fair.

Case 1: list of suppliers

One: clarification of requirements (producing specific examples)

Customer: all supplier lists need to be made into a "good form"

Developer: can you give me an example? What is a "good form"?

Customer: here is an example:

Discussion: it is found that if there is a slight difference, repeated input will occur (such as the same supplier, different booths, etc.).

Development: what kind of data in the database can export a "good supplier list"

Customer:

From the table above, it can be found that there will be some repetition for the same supplier due to different booth information, beauty and logo.

II. The requirement examples are extracted into test cases of Robot framework.

Here is a brief introduction to Robot framework. For more information, please see www.robotframework.org

Robot framework contains 4 tables:

Test case table: contains the actual test cases with the header "Test Case"

Keyword table: contains the underlying user keywords that make up the structure of the test case, with the header Keyword or "User Keyword"

Setting table: allow references to files, lib. The header is "setting" or "settings"

Variable table: declare variables with a header of "Variable" or "Variables"

The following is the procedure for calling Robot framwork:

The test case and user keywords are filled in Robot Framework, and Framework calls test libraries, which then calls the system under test.

Now extract the test cases from the example.

Test case execution, found keywords "Stand input", "Is stand output", "Has no extra stands" are undefined.

Next I use user keyword to implement "Is stand output" and "Has no extra stands".

Run the test case again and find that the following keyword is not defined: "Stand out", "Get current log", "Get current name", "Get current place", "Stands left". These keywords will be implemented in test library.

The current system to be tested is written in C language and can be called through the user interface or directly. This case uses a direct call (using ctypes foreign library). The test library code is as follows:

Conclusion:

A-TTD is a collaborative requirements clarification tool that uses executable use cases to explore requirements. Requirements-- > requirements example table-- > Robot table-- > executable use cases (table representation)

Robot Framework is a testing framework based on A-TDD. It uses a tabular structure to express a use case, and then uses test libraries to realize the executable words of the use case.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 218

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report