Back-end Engineering
122 learners
Refactoring by Leveraging Your Tests with TypeScript & Jest
This course focuses on the Refactor step in TDD, teaching developers to spot code smells and resolve them through refactoring. Using real-world examples, you'll identify common issues, apply refactoring techniques, and ensure functionality is preserved with existing tests.
Jest
TypeScript
See path
5 lessons
22 practices
3 hours
Badge for Computer Science Fundamentals,
Computer Science Fundamentals
Lessons and practices
Refactor Duplicated Code in the Tests
Refactor Tests using Parameterization
Extract Function: calculateItemCost
Refactor duplication between calculate functions
Refactor Magic Numbers to Constants
Extract user validation logic
Extracting validation into validator classes
Extract data normalization code
Setting our sights on the DataStore
Extract Result Type
Streamline Parameters with a Parameter Object
Introduce a CoursePolicy parameter object
Re-order parameters for cohesion
Provide defaults for most parameters
Extract StudentGrade Logic
Refactor: MoveMethod calculateFinalGrade
Eliminate the GradeAnalyzer
Eliminate Feature Envy from the Student
Extract a CartItemCollection
Extract the PriceCalculator class
Extract a DiscountCalculator class
Write Tests for Extracted Classes
Meet Cosmo:
The smartest AI guide in the universe
Our built-in AI guide and tutor, Cosmo, prompts you with challenges that are built just for you and unblocks you when you get stuck.
Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal