Postingan

Menampilkan postingan dengan label Testing

JUnit Testing Tips - Constructor is Called Before Executing Test Methods

Gambar
Even though almost all Java programmers either use JUnit or TestNG for there unit testing need along with some mock object generation libraries e.g. Mockito, but not everyone spends time and effort to learn subtle details of these testing libraries, at least not in proportion of any popular framework likeSpring or Hibernate. In this blog post, I am sharing one of such detail, which has puzzled me a couple of years ago. At that time, though I had been using JUnit for a significant time, I wasn't aware that code written inside the constructor of Test class is executed before each test method.  This behavior of JUnit has caused, some of my test to failed and putting hours of investigation in my code, without realizing that this is happening because of JUnit is initializing the object by calling constructor before executing test method annotated with @Test annotation. I had the following code to test my vending machine implementation as a coding exercise. If you look at closely, I have...

Top 5 Courses to Learn Selenium for Java Developers and Automation Testers - Best of Lot

Gambar
The days of manual testing is limited as more and more companies are shifting towards Automation testing. This means all manual testing QAs needs to learn new test automation skills like Selenium, Cucumber, JUnit, Mockito, and TestNG to give their career a boost. If you are manual testers or non-programming testers interested in learning test automation, a Java developer who wants to write a better integration test, or a freshers/graduates who want to kick start their career in automating testing then you have come to the right place. In this article, I am going to share some of the best courses to learn Selenium Webdriver with Java and other automation testing tools like JUnit, Cucumber, etc. Today's software development world uses TDD (Test Driven Development) and BDD (Business Driven Development) practices and requires continuous integration and continuous deployment using Jenkins and Maven. Automation testers are needed to develop robust, clean, and thorough frameworks for regr...

Top 5 Books to Learn Unit testing, JUnit and TDD in Java - Best of Lot

Gambar
Hello guys, If you done some professional Java development then you know that Unit testing is a very, very important thing to learn to adapt. I would say this is the single most practice in my book, which differentiates an excellent programmer with a professional programmer. It's one way you can see how disciplined a programmer is? It's also the best way to write clean code; a code that can stand the test of time, a code that is flexible enough to accommodate future changes and a code that you don't afraid of while changing. Despite several efforts of promoting unit testing by programming community and emphasizing unit testing by many notable programmers, it's still one of the lacking practice. In my effort to encourage developers to do unit testing, I try to make it natural rather than a special thing. I have found that it's not that programmer doesn't want to test, or they don't have time, it's because they don't really know how to unit test a non-...