课程: Software Testing Foundations: Continuous Testing and DevOps

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

How to make your tests independent

How to make your tests independent

- [Instructor] So, let's talk about how to make your tests independent. In order to make your tests run well in a continuous integration environment, you need to make them run independently. An independent test is one that's responsible for its own state and data. Why? Let's take a library application as an example. What are the important workflows of a library application? Users need to be able to search for books, sign in to their accounts, and check out the books they want. So for a test to be independent, we can't really rely on there being a user and a set of books already generated in our application. Instead, we'd want to test workflow to look like this. Create a user, create a book, log in as the user, find the book, and check out the book. Why would you want one test to be responsible for all of this? It is a pretty lengthy test, to be fair. We'll talk more later about how to keep your tests short, while…

内容