Skip to content

clean-code-craft-tcq-1/function-ext-cs-RaghavendraSR06

Repository files navigation

Programming Paradigms

Electric Vehicles have BMS - Battery Management Systems

Here is an article that helps to understand the need for BMS

Wikipedia gives an idea of the types and topologies

This site gives the optimum Charging-temperature limits

This abstract suggests a range for the optimum State of Charge

Here is a reference for the maximum charge rate

Possible purpose

  • Protect batteries while charging: at home, in public place, within vehicle / regenerative braking
  • Estimate life, inventory and supply chains

The Starting Point

We will explore the charging phase of Li-ion batteries to start with.

Issues

  • The code here has high complexity in a single function.
  • The tests are not complete - they do not cover all the needs of a consumer

Tasks

  1. Reduce the cyclomatic complexity.
  2. Separate pure functions from I/O
  3. Avoid duplication - functions that do nearly the same thing
  4. Complete the tests - cover all conditions.
  5. To take effective action, we need to know the abnormal measure and the breach - whether high or low. Add this capability.

The Exploration

How well does our code hold-out in the rapidly evolving EV space? Can we add new functionality without disturbing the old?

The Landscape

  • Limits may change based on new research
  • Technology changes due to obsolescence
  • Sensors may be from different vendors with different accuracy
  • Predicting the future requires Astrology!

Keep it Simple

Shorten the Semantic distance

  • Procedural to express sequence
  • Functional to express relation between input and output
  • Object oriented to encapsulate state with actions
  • Apect oriented to capture repeating aspects

Functional Extensions

  • Early Warning - Warning message has been given in English and German for users.
  • Support a language in addition to English - German language option added by setting in global variable.

About

function-ext-cs-RaghavendraSR06 created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published