Is unit testing a meme? does it help you in your everyday life? when is it ok not to unit test your app?

is unit testing a meme? does it help you in your everyday life? when is it ok not to unit test your app?

Attached: Sb4kYtw[1].png (1280x1296, 786K)

it's ok to not unit test your app if it's small or if you're the only person working on it.

It's good at catching regressions, it's useless for testing if the software works correctly.

Test driven development and build tools are fucking cancer driving the code monkey pajeet imports

It has saved me an assload of time in my personal projects since after you make that first investement of time to get them started, you can make massive dick-swinging changes across the program and your unit-tests will tell you exactly what you fucked up, rather than waiting for it to appear later as a bug

Maintaining unittests is also a breeze for any non-retard

I love the assholes who are unit testing an app with a framework and bootstrap the entire fuck framework to unit test a three line function.

not worth

Testing is a meme.

if (1) //checks that computer works

That's just web development in a nutshell.

Test-driven implementation can be useful if you are beginning and don't full understand exception handling or how brittle poorly written code can be. Ultimately though I think the overemphasis on write unit tests before you even think about writing software is a product of academia more than anything

Not a meme, but hard to keep it up on real world. Just that.

How to unit test? I've done it using junit libraries but I really didn't know what I was doing. I guess I cod just look it up at some point.

if you work in a great team with great lead, unit tests are epic, especially as someone mentioned for catching regressions.
in my experience that never worked in teams i worked in, they go obsolete within a month as they don't get updated when various geniuses spill their talent all over the code.

tdd? i don't have an idea how's that supposed to work, at least in the real life.

Since you seem to have the hang of it, can you explain the advantage of unit tests as opposed to integration tests? Seems to me like the latter
>are easier to write
>require less maintenance, when you shuffle around the internals without changing behaviour tests don't need updating
>require less boilerplate, as you don't have to mock 90% of the program context to test some deep internal functions
>correspond to testing what actually matters - users won't see whether your individual functions return the correct values, they'll see what's displayed on the screen or returned by the API etc.
I guess an argument against integration tests is that it's harder to catch all possible edge cases in a complex program than to do that 100 times over but only for a single function each time, but decoupling your functionality into a service-based architecture can help with that, among its other many maintainability benefits.

So why unit testing specifically?

its 100% a meme unless youre developing an always-on api. people who shill it are fucking ruby fags, the lowest form of developer.

unit tests are self contained to the unit they're testing and can be run without having to run or mock the entire application.
they're good for catching small bugs or just testing the functionality of self contained modules.

All of those apply to unit tests as well. When developing UI your unit tests should only test user visible behavior. The difference between unit tests and integration tests is hermeticity.

it doesn't test that everything works, it tests that interfaces haven't changed. I've always found it to not have a good ROI on a project. Some sperg always wants to blow all his time on 100% coverage or some other TDD meme. Fuck them, they're retarded. I've sold software to companies that had like 8% coverage, and just worked.

Attached: fry-heretic.jpg (610x616, 70K)

kek. this. So fucking funny. So you load about 400MB of code so you make sure something in the stdlib still works. Nice work, Ranjeet.

var_dump
exit

>I think the overemphasis on write unit tests before you even think about writing software is a product of academia more than anything

I disagree. Software written in academic settings (by researchers, not for classes) is hardly tested. Deadlines are way too pressing and the structure of Academia is basically "solve the problem, write the code."

Demand for testing skills come from industry. Otherwise, it's impossible to do work while being reasonably sure you're not breaking anything.

Unit tests and integration tests complement each other.

As other anons mentioned, unit tests verify local properties about software. For instance, you have a sort function. Does it handle edge cases such as empty lists or lists containing duplicates? These behaviors are checked with unit tests.

Integration tests verify properties about entire systems. For instance, suppose you have a website that requires a database to function. Does the site return the right response when the database can't be accessed? Behavior like this is checked with integration tests.

It's very nice if the code base has been around long enough that people are leaving or you need to refactor things. Its nice to know that at the very least new code is as performant as old