Breaking News

Please Help Community by G+

Body Mass Index (BMI) calculator with JUnitTesting in Java


Aitor Tilla S.L. clinic specializes on the endocrine treatment of people with diverse needs in relation to weight control. The clinic wants to launch a number of technological solutions (mobile app and web pages) that will allow its clients to have an effective monitoring of the dietary plans suggested by the clinic doctors. To this end, Aitor Tilla, S.L. requires to evolve the component that measures metrics for a healthy life developed during the previous guided exercises. The component will be reusable and will allow the calculation of new necessary metrics. The component will be developed in Java, J2EE platform, and will be delivered in a JAR format that will allow the access to the methods, and the programming interface that integrates with the mobile app and web pages. In addition, the code will be delivered with a user manual that explains programmers how the integration with other components should be done. The function to consider consists of characterizing the Body Mass Index (BMI) considering the following information: Age, Height, Weight and Gender. To provide the data needed for each of the aforementioned functionalities text files will be used (formatted using JSON) that will contain the input data. The specific format of the input files must be defined by the student and included in the Software Requirements Specification. The input of the functionality to provide must be the path where the input file to process is stored. As result, this functionality must provide an object that contains the BMI value calculated and the classification (Extreme Thinness, Thinness, Optimal, Excess Weight and Obesity) included in a specific data type that the student has to define. It is necessary to consider that the height data can be provided in meters or feet and the weight data in kilograms or pounds. In case of any error in the format or semantic of the values included in the input file, the components must provide an exception that includes a textual field with a representative message of the error identified. The formula to calculate is: BMI = Weight in KG. / (Height in cm) 2 The BMI classification will be processed attending to the ranges included in the following table. Due to these values change periodically, the information included in the table must be stored in a file or database that needs to be queried any time a calculation request is done to the component.

Note that a JSON file format will be used to transmit the information required in previous points. You will need to clearly define the specific format needed for each of the functionality in the requirements specification section. Similarly, the resulting values will be returned in a specific data type you will need to define. Finally, the resulting software component should be available as an independent Java Package that can be imported and used by the developers in charge of the software maintenance and the development of other software systems used by the company.


  • Definition and Automation of Unit Tests 1.
    1. A document that defines all the test cases (using black box technique) for each of the methods for the program’s public interface defined for this component.
    2. The source code that automates the test cases defined in previous point 1. All cases should be appropriately commented.
  • Source code and executable
    1. Attach to the submission the source code and executable file that implement the proposed solution
    2. A registry generated by JUnit that includes the results for each of the test cases defined in your submission.

Hassnain Jamil

Hassnain Jamil

No comments:

Post a Comment

Powered by Blogger.