Skip to content

This project aims to exercise the "code smells" related to unit tests using an application that simulates a real business. The code will be developed with the Detroit-style TDD technique

Notifications You must be signed in to change notification settings

douglasdcm/tdd_detroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

{Translated from Portuguese to English using AI}

College Student Grade Control

Introduction

This project aims to practice development skills using an application that simulates a real business scenario. The code will be developed using the TDD technique in the Detroit style, hence the name of the repository. The application simulates the control of grades for university students.

Experimentation

This application has been used to exercise skills relates to Python, ORM, TDD, Kubernetes and other tools. Each exercise is hosted in specific branches. This is the list of them:

  • first_version: was the first attempt to build the application in Python using TDD. It almost does not use any 3rd-party library, just built-in and personal code. The code is in Portuguese.
  • postgres_orm: A similar implementation of the 1st version, but using SqlAlchemy as a ORM and Alembic to handle database migrations. It also uses Docker, Kubernetes, VSCode Live Server for debug, Flask and PyScript. Ti is the most complete and complex architecture.
  • calico: The attempt to integrate Calico K8s Network and Kubernetes Cluster to allow the communication of containers in different Pods. It is incomplete.
  • kubernetes: more specialized exercises with Kubernetes, but not so different of postgres_orm.
  • kubernetes-no-postgres: exercise using Kubernetes and the database PostgreSQL. The other branches use SqLite.
  • pyscript-postgrest: The implementation of a Web app using PyScript and Postgres as a REST API (PostgREST). PyScript web pages does not connects to Postgres as the ones created with Javascript do.
  • architecture: In this branch I exercised my skills of sofware architecture. I tried to do sufficient design up-front to ilustrate the relationship of the entities and features. I found some inconsistences in the app requirements list that I fixed and replicated to this branch. I also implemented the authentication and authorization features. This is the most complete app, as almost all of the requirements were implemented.
  • c-implementation-1: First version of the App in C language. The other ones use Python.

Application specification

Architecture

Slides with specifications (Libre Office file)

Below is the specification of the application: Definition of Done:

  1. Unit tests cover the functionality.
  2. The functionality is developed to be used via CLI (Command Line Interface).
  3. Data is being saved in the database.

Deliverables

Construction of the basic functions of the system

  1. Each student will have a grade control called "grade point average" (GPA).
  2. The GPA is the average of the student's grades in the courses subjects already taken.
  3. The student is considered approved at the university if their GPA is above or equal to 7 (seven) at the end of the course.
  4. If a student takes the same subject more than once, the highest grade will be considered in the GPA calculation.
  1. Initially, the university will have 3 courses with 3 subjects each.
  2. Subjects in each course may have the same names but will be differentiated by a unique identifier (niu).
  3. The system must calculate the student's situation taking into account the subjects taken and the total number of subjects in each course.
  4. The student can only take subjects from their course.
  5. Courses must have a unique identifier and name.
  1. The maximum grade for a student in a subject is 10.
  2. The minimum grade for a student in a subject is 0.
  3. The student can lock the course, and in this case, they cannot update their grades or the subjects taken.
  4. The course coordinator can list the students, grades in each subject, and GPAs of the students.
  5. The student can unlock the course, and their situation returns to the previous state.
  6. Students must have names.
  7. The general coordinator can list all courses, students, grades in each subject, and GPAs of each student.
  8. The course coordinator can remove subjects, and in this case, students cannot update their grades in that subject.
  9. Students can only update their grades in the subjects they are enrolled in.
  10. Course and subject names must have a maximum of 10 letters.
  1. Courses can have the same names if they are from different units.
  1. The student can only enroll in one course.
  2. The coordinator can coordinate a maximum of three courses.
  3. The coordinator can list the students, subjects, grades, and GPAs of all their courses (coordinator of more than one course).
  1. The course can be canceled by the general cordinator.
  2. Canceled courses cannot accept student enrollments.
  1. Canceled courses cannot have coordinators.
  2. Each subject can have a maximum of 30 enrolled students.
  1. The student must enroll in a minimum of 3 subjects.
  2. If the number of subjects missing for a student is less than 3, they can enroll in 1 subject.
  3. If the student does not enroll in the minimum number of subjects per semester, they will be automatically failed locked.
  4. The student must have a validated CPF (Brazilian Social Security Number) in the external CPF validation system (government system).
  5. Add the course name to the coordinator's reports.
  6. The students are only approved if they achieve the minimum grade in all course subjects, even if their GPA is above the minimum.
  1. The user student (person) must be able to create students with basic information.
  1. The user must be able to enroll the student in a course.
  2. The user general coordinator must be able to create courses with the minimum number of subjects.
  3. The administrator, and only the administrator, must be able to list all students with detailed information (all available information).
  4. The administrator, and only the administrator, must be able to list all courses with all available information.
  5. The administrator, and only the administrator, must be able to list the list of students per course.
  6. The administrator, and only the administrator, must be able to list the list of subjects per student.
  7. The students must be able to list all subjects only from their course.
  8. The students must be able to list all subjects they have taken.
  9. The students must be able to list the missing subjects.
  1. The administrator must be able to list all course coordinators with available information.
  2. The student has 10 semesters to graduate.
  3. If the student exceeds the 10 semesters, they are automatically failed.
  1. The coordinator can only coordinate a maximum of 3 courses.
  2. The general coordinator cannot be a coordinator of courses.
  1. The teacher sets thes grade for all students of his/her subjects
  2. Each teacher may teach in 3 subjects at maximum
  3. The general coordinator is responsible to open and close the semesters
  4. The general coordinator is responible to add students to enrollment list after manual analysis of thier documentation
  5. The corse coordinator is responsible to add new subjects to his/her course
  6. The general coordinator is responsible to add new courses to the university
  7. The student, teacher and coordinators need to authenticate with valid credentials before perfom any action in the system
  8. The course need a minimum enrollment of 100 students
  9. The subject need a minimum enrollment of 10 students
  10. Student can enroll to course again after fail it losing all his/her history

About

This project aims to exercise the "code smells" related to unit tests using an application that simulates a real business. The code will be developed with the Detroit-style TDD technique

Topics

Resources

Stars

Watchers

Forks

Languages