Listen "142 - 6 Ways to improve your code tests"
Episode Synopsis
Change log: All the code notes for Docker for beginners course has been written. This is available on GitHubI’ve started work on transcribing that course. This will take a long time.I’ve fixed issues on howtocodewell.net regarding signup, forgotten password and other minor fixesI’ve added the functionality to lock and unlock courses. This will turn them into private or public courses that require enrolment 6 ways to improve your testing 1) Automate as much as you can Use CI pipelinesRun these locally even if your’e not committing any changesInclude other code auditing tools such as phpstan or phpmd 2) Statics are evil There is no way to test a static method that calls another static method 3) Having many mocks is an indication of bad code design 4) Use tests to help refactor you code If a unit of work cannot be easily tested then it usually means the code is not designed wellBreak up your tests into smaller chunksTests can highlight micro and minor refactorsRefactor your code and then re testTry and do this in a TDD fashion 5) Avoid flaky tests Clean up stateCheck for bottle necks which could cause timeoutsMock external services or dependanciesLook into potential memory leaks 6) Re think what testing means to you Testing is a contractual agreement between the programmer and the codeTesting is documentation - Gherkin, Acceptance Criteria, Business requirementsTesting is boundary setting which helps with focusTesting is future proofingWatch the show on YouTube Contact me and let me know your thoughts or get something read out on air. My web development courses ➡️ Learn How to build a JavaScript Tip Calculator ➡️ Learn JavaScript arrays ➡️ Learn PHP arrays ➡️ Learn Python ✉️ Get my weekly newsletter ⏰ My current live coding schedule (Times are BST) Thursdays 20:00 = Live Podcast YouTube Sundays 14:30 - Live coding on Twitch
More episodes of the podcast How To Code Well
191 - NHS legacy IT meltdown
23/02/2023
190 - AI Land Grab
26/01/2023
189 - Grounded by code
15/01/2023
188 - Maintain the line
06/01/2023
187 - 2023 Web development trends
18/12/2022
185 - Costly Clouds
02/12/2022
184 - Get better code reviews
24/11/2022
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.