2
2

[–] justletmevoat 2 points 2 points (+4|-2) ago 

Unit tests are overrated.

0
4

[–] TheGuyWithFace 0 points 4 points (+4|-0) ago 

While in certain applications I might agree with you, for a full-featured website like voat I just have to disagree with you. Unit tests can be annoying to write, and their benefit might not be super apparent at first, but in the long run, well written tests are very very valuable IMO.

2
1

[–] justletmevoat 2 points 1 point (+3|-2) ago 

They break stupidly when code changes, and people defend them saying "Oh, well, good unit tests don't do that", and then these good unit tests never exist, and you've got to stub or mock everything, so your tests don't test any fucking thing useful, and then the API for the DB library changes or you have to update versions and you have not only update your tests to that, but also the fucking stubs.

Fuck unit tests - out of all the different kinds of testing possible it is the most useless.

0
1

[–] Tenayden 0 points 1 point (+1|-0) ago 

I agree with @TheGuyWithFace. While unit tests are very annoying to write and more work upfront, the benefit of knowing your broke that ancient obscure method X with a recent change prior to deployment instead of a user asking why X no longer works "like it used to" makes it all worthwhile.

0
4

[–] ptd 0 points 4 points (+4|-0) ago 

It looks like they sort of do. If you look in the UnitTests.cs file there's a few tests in there.

https://github.com/voat/voat/blob/master/Whoaverse/UnitTests/UnitTests.cs

But it doesn't seem like it's something they do consistently (last commit was May 19).

0
1

[–] pkhagah 0 points 1 point (+1|-0) ago 

I think they are doing a huge refactor now and will eventually get to unit tests.

0
1

[–] ptd 0 points 1 point (+1|-0) ago 

Yeah no doubt. From what I understand they started this project as a learning experience in college or something. I skimmed through some of their code and from what I can see I would focus on a few things:

  1. Abstract business, data, and infrastructure logic into separate projects. This will make writing for scalability easier in the future if they decide to move to a queue driven pattern or something. It will also make the code easier to read and more modular.
  2. Remove left over VS template code.
  3. Move scripts/styles/etc to a CDN.
  4. Use some sort of DI/IoC with Autofac, Structuremap, etc.
  5. Get ready for a load balanced environment. If they use something like azure wep apps or azure cloud services this is pretty easy. Even SignalR has a single line configurable backplane with SQL, Azure Service Bus, or Redis. It's actually a fairly cheap solution.

0
1

[–] dwarmia 0 points 1 point (+1|-0) ago 

I am not part of the team and they don't know me :)

But i am looking the source code really close, i might start writing unit tests soon.

PS : Test Driven Rulez !

0
1

[–] theonlylawislove 0 points 1 point (+1|-0) ago  (edited ago)

0
0

[–] mortimer ago 

Skimming the source, it would be pretty hard to write retroactive tests for Voat. The forum even uses inline SQL instead of a simple database namespace that would let you stub out the database calls during testing.

Since this project started out as a sideproject for a guy to learn .NET (as opposed to a profitable company), tests are just not something I'd expect. And backfilling a project with tests is even harder than writing them in the first place.