Unit tests are not stupid, here is another argument for using them

preview_player
Показать описание

My VSCode Extensions:
- theme: material community high contrast
- fonts: Menlo, Monaco, 'Courier New', monospace
- errors: Error Lens
- extra git help: Git Lens
- tailwind css intellisense
- indent rainbow
- material icon theme
- prettier & eslint
- ES7+ React Snippets
Рекомендации по теме
Комментарии
Автор

I think testing is so important for any piece of software that reaches a certain scale. It enables fearless refactoring and easier pinpointing of the eventual errors one will run into. TDD, in particular, is a very cool approach to it all, imo.

LoZander
Автор

Stumbled on this channel a few days ago and I'm loving the content. Keep it up!

keifer
Автор

Great take on real world problems. People complaining in the comment about testing either never worked long or hard enough on a project or are just superhuman with perfect memory ability. I would argue that the first case is more likely ^^

Goyo_MGC
Автор

Love you babe! Good job, keep it up ❤️

SeibertSwirl
Автор

I want to emphasize the importance of writing tests based on the interface and functionality of the program, not the implementation.

Imagine you're building a chess game, and you want to check that moving a piece actually moves it. Let's say you've implemented the board using a 2D array.

If you then, to test, check that a piece is in a certain location by doing something like board[3][2], then you effectively hardcode into the test that the chess board in implemented using a 2D array. What if you later want to implement it using a map of from coordinate to game piece, or something? Now you have to change the test.

If you instead design the test to only use the interface of the chessboard, you could just write board.getPiece(3, 2) and then you never have to change the test.

This is why, when designing tests, you should always interact through the interface and never the specific implementation.

LoZander
Автор

Your videos are getting better and better

DrExpresso
Автор

Good unit tests with high coverage are also the foundations for setting up continuous integration and delivery pipelines. Without unit testing you will lose that instant feedback loop that continuous integration gives you (merging daily, seeing a build passing/failing).

lunarmare
Автор

Been wanting to learn how to write tests in my full stack applications. Going to sort through some of your older videos and mess around a bit. Thanks for the great advice. Loving the vids !!

Leanz
Автор

Your videos are nice. Concise and to the point. Good luck

Cyber_Lanka
Автор

I think for 80% of the projects I work on (aka personal, simple, or one-off projects), unit tests are entirely unnecessary. Maybe another 15% benefit greatly from them. The last 5% absolutely need them.

Amy_A.
Автор

If you write software for your own purposes, you beg yourself to debug, architecture well and test code. Engineering can be fun. :D

renifer
Автор

Who on earth makes the argument for unit tests being stupid? The only possible explanation in my mind is that the one who does this hasn't used them in a production environment with real value being delivered. There is no reason not to write unit tests. This methodology reduces the chance of side effects, pushes you to think about what your code is doing, forces good programming practices such as dependency inversion, abstraction, maintainability, and the list goes on. If in this day and age you're still writing untested code I don't know what to tell you. Better ways have been around for over 30 years. It is your responsibility to be good at what you do.

everythingiscoolio
Автор

Can you a video on how you install jest and rtl to vite as shown in the vid?

Chriss-cnch
Автор

How big is the team you work on that you are referring to?

lazerwolph
Автор

Which one is that extension that highlights the indentation?

sanketower
Автор

how important is it to test React components

SahraClayton
Автор

Great video, well done mate, very informative.

devoiddude
Автор

maybe just writ a single line comment that explains

// sorts in a particular way, example:
// ["test", "test3", "test1"] => ["test1", "test3", "test"]

ts
Автор

Unit Tests are not stupid
but e2e tests / integrity tests are aWeSoMeEe

Ca-rpbv
Автор

Hot take:

Honestly you can stop at 0:50. If, as a developer, you cannot understand the code of your colleagues you are not ready to be working in the environment you're in. There is no test that can make up for a lack of understanding. Whether testing is good or bad is not for me to decide, but developers should -- at a minimum -- be able to understand code that is put in front of them for the first time. It's not like your team is pushing code in languages you've never seen when you're building the same product. Especially with more "toy" languages like JS, you should be able to look at any code block or function and determine exactly what its doing before you are ready to be a professional developer. It's completely fine if you aren't at that point yet; but if your team's code actively confuses you then either something is wrong with your team or something is wrong with your qualifications to be on that team.

explodatedfaces