Source Allies Logo

Blog Insights

  • testing icon

    Would you start mocking me?

    One of the primary principles of unit testing is to test a small piece of functionality in isolation. In order to achieve this, mock objects are often necessary. Historically using mocks could be quite painful. After using several mock frameworks, my favorite by far is Mockito. java Person mockPerson = Mockito.mock(PersonImpl.class); assertNotNull(mockPerson.getChildren()); assertEquals(0, mockPerson.getChildren().size()); assertFalse(mockPerson.isCitizen()); assertEquals(new...
  • testing icon

    Developing a multithreaded test harness

    You can't ignore the fact that web servers are multithreaded. We can hide as much as we want, but sooner or later you'll find yourself in the situation where your application works fine during development and testing; but once it hits production you start hearing about "funny" things happening. While...
  • testing icon

    Sonar - Code Quality Analysis Tool

    Sonar is a web based code quality analysis tool for Maven based Java projects. It covers a wide area of code quality check points which include: Architecture & Design, Complexity, Duplications, Coding Rules, Potential Bugs, Unit Test etc. Sonar has a rich set of features like what you would get...