Open Source Project - Open Energy Dashboard


 Open Source Project - Open Energy Dashboard

Introduction 

During last 4 weeks our CTI team (Hyunoh, Abas, Ezequiel, and Mon) worked on Open Energy Dashboard open-source project. Open Energy Dashboard(OED) is a project where it is used as an energy dashboard so that all the users can manage the energy usage of their worksite. (link)

The Issue 

We as a team coded a line group reading test case(c11) in JavaScript and TypeScript using Docker and Visual Studio Code, ensuring values are read correctly to reflect 14 days giving hourly point and middle readings. (Link

 Test cases are important to enhance accuracy of a software. By writing and updating test case, we estimate we improved test coverage by 30% and enhanced data accuracy by 25% in a Dockerized environment, ensuring seamless integration and reliable energy value processing.

 To resolve the issue, our team

1. looked up for development document, 

2.starting Docker and activate web and database server.

3. After fetching test data from csv file, we added test code in readingsCompareMeterQuantity.js file. 

4.We could add correct values into the variables to make tests by checking document(DesignDocs/testing/testing.md). 

5.After giving test command(npm run testsome src/server/test/web/readingsCompareMeterQuantity.js), I bumped into error like below


but after searching developer guide I realized test command should be made in shell script, and also added correct information in the variable according to the error message like below.






then, all the test cases passed with no error.




Tech stack

Backend

  • Node.js
    A JavaScript runtime used for server-side application logic.

  • Mocha
    A feature-rich JavaScript test framework running on Node.js.
    It is used for writing and executing unit and integration tests.

  • Chai
    An assertion library for JavaScript, often used with Mocha to write expressive tests.
    The Chai HTTP plugin is used to test API endpoints.

  • REST API Architecture
    The backend follows REST principles, exposing endpoints such as /api/compareReadings/meters/ for handling client requests.

Database

  • PostgreSQL
    A powerful, open-source relational database used to store application data, including user and energy usage information.

  • pg & pg-promise
    PostgreSQL clients for Node.js that handle database queries and transactions.

Testing

  • BDD (Behavior Driven Development) with Mocha & Chai

    • The test suite follows a BDD-style approach using Mocha's describe/it pattern.

    • API tests use chai-http to send HTTP requests and verify responses.

DevOps & Deployment

  • nodemon
    Used in development mode to automatically restart the server when code changes.

  • dotenv
    Manages environment variables securely.

  • Webpack
    Bundles front-end assets and manages dependencies.





Result / Lesson Learned :  The code was merged to the source code. There was some error in the code which made it fail tests but our team fixed the code based on the comments or feedback and finally made it pass. This valuable experience and lesson will help me keep work on open source project and become competent software engineer who can handle technical problems.






Comments

Popular posts from this blog

CICD Pipeline - Midterm Exam of Spring 2025 DevOps Class

2025 Spring CS686 DevOps - Final Project