Abstract Although software testing is a crucial activity in the software development process, only recently have more sound and consistent testing tools become available for testing Java programs and their components. These tools support mostly functional and control-flow based structural criteria. In this paper we explore control-flow and data-flow based coverage criteria to support the testing of Java programs and/or components. We also describe a testing tool, named JaBUTi, which can be used by both the component developer and the component user to test Java-based components and/or systems. To achieve this goal, the tool works at the bytecode level such that no source code is required during the testing activity. We illustrate these ideas and concepts with an example extracted from the literature.