1) Analyzing concurrent code with FindBugs:
The static code analysis tools are a set of tools that analyze the source code of an
application looking for potential errors. These tools, such as Checkstyle, PMD, or FindBugs
have a set of predefined rules of good practices and parse the source code looking for
violations of those rules. The objective is to find errors or places causing poor
performance early, before it will be executed in production.
One of these tools to analyze Java code is FindBugs. It's an open source tool that includes
a series of rules to analyze Java-concurrent code.
2) Testing concurrency code with MultithreadedTC:
MultithreadedTC is a Java library for testing concurrent applications. Its main objective is
to solve the problem of concurrent applications being non-deterministic. You can't control
their order of execution. For this purpose, it includes an internal metronome to control
the order of execution of the different threads that form the application. Those testing
threads are implemented as methods of a class.
The MultithreadedTC library is based on the JUnit library, which is the most often used
library to implement unit tests in Java. To implement a basic test using the
MultithreadedTC library, you have to extend the MultithreadedTestCase class. This class
extends the [Link] class that includes all the methods to check the
results of the test. It doesn't extend the [Link] class, so you can't
integrate the MultithreadedTC tests with other JUnit tests.