Java testing notes

Test objects Dummy – returns default value

  • Stub – returns a valid predefined value
  • Mock – contains some logic
  • Fakes – valid but generated data

Testing persistence -> stubing/mocking entity manager or faking a data from in-memory database

BDD -> cucumber

Useful tools: EqualsVerifier, Testing RxJava, Hamcrest matchers

Spock – high level groovy based framework, can work over junit and cucumber, nice and concise syntax

Static code analysis of test coverage – cobertura

WEB testing – selenium, arquillian

htmlunit – simple html client for testing WEB app

pageunit – checking up-ness

Static code analysis – xlint javac’s option, PMD (command line, eclipse addon, maven plugin), checkstyle, CPD

Bytecode analysis – FindBugs, Fortify

Advertisements

About DmitryKrinitsyn
Software developer and muay thai adept

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: