Tag Archives: clean

My series of Maven related articles is out now

If you haven’t seen, this week i released my series of 2 articles to help get you started with Maven. In the first one, i discuss how to setup Maven on your machine and how to create a brand new Maven project. I also explain key concepts that define what Maven and a Maven project are (like dependencies). Check out this article here: https://blog.testproject.io/2021/06/28/getting-started-with-maven-part-1/.

In the second installment in this series, i further discuss some specifics about dependencies. Then, i go over project goals, how you can run your tests, and how you can create profiles and use system properties in your test run. Check it out here: https://blog.testproject.io/2021/06/28/getting-started-with-maven-part-2/. Enjoy.

Read my new article on tips for clean code

Read the article i wrote for the TestProject blog on general tips for why and how we can achieve clean code in our automation: https://blog.testproject.io/2020/04/22/clean-code-in-tests-what-why-and-how/

Write clean code for your tests by using the separation of concerns principle

When i look at a test class, what i want to see is clean code. What i mean by that is, well a few things, but the most important one: i want the test class to hold the code for the tests, not the code for everything but the kitchen sink.

When we write tests we have a lot of data to prepare for them. Whether this is the ‘expected’ or the ‘actual’ data used in the tests, or some auxiliary code that we need, there always is some processing that needs to be done, apart from the actual asserts that a test should do.  What the test class should contain is only the checking / asserting part, while having specialized classes generate all the data that is required in the test. A test class should only check the actual data against the expected data. This is the separation of concerns principle. Continue reading Write clean code for your tests by using the separation of concerns principle