Hacker News new | ask | show | jobs
by sniperjzp 1472 days ago
I'm wondering how to test those thousands lines of C++ code, a lot of them are compute-intensive, I don't see any unit test.
5 comments

Not sure if this is a joke but unit testing is generally not used in games, definitely not in plam games 20 years ago.
Games use integration tests. You push a new build to steam and check reddit to see if it worked.
Hilarious post that's also sadly quite accurate.
That's the same way Microsoft tests their updates.
Unit testing is not too rare in (modern) games.

There's a comment on HN from a Rare employee going into how they do their testing, for example - https://news.ycombinator.com/item?id=14802509

Edit: It's a 5 year old thread and I have a few comments in there... Fuck I'm old.

> Unit testing is not too rare in (modern) games.

In my experience, unit testing is _incredibly_ rare, and Rare are pretty much the only studio that I'm aware of that do it.

Unit tests are a relatively recent concept (last 15-10 years?).

I know plenty of old developers who crank out pretty awesome software without versioning and without any kind of automated testing.

For most applications (especially UIs or 2d / 3d rendered), I think there is a benefit in having a few well chosen tests but overall I think TDD does more harm than good.

I understand the mantra started in the web world, where your services needs to maintain the promised compatibility or someone else may get an error. A lot of other software can afford to be more flexible and the ability to break the API without having to fix hundreds of tests is invaluable.

Even in web services, I think the TDD religion guilt trips developers into writing more useless tests than they should.

> Unit tests are a relatively recent concept (last 15-10 years?).

I was writing unit tests 20 years ago. I generally see SUnit considered as the birth of unit testing frameworks, and that's 30 year old art to solve something that was being done before anyway.

I guess one can say that Extreme Programming made it more popular in the mid 2000s, which is when relatively new languages started including built-in/standard unit testing libraries/frameworks/semantics (Python, Ruby, D...)

I was seeing Extreme programming being a thing and using DUnit for Delphi in the late 90's (possibly early 2000, but I left the Job I was using this for by mid 2000.)
> A lot of other software can afford to be more flexible and the ability to break the API without having to fix hundreds of tests

This is really question of good high level system design, so you don't need to change all code in case of small changes in overall behavior.

Other name of this is tight coupled vs loose coupled system.

Those games are written in C, and unit tests 30 years ago?!?

The only tests were actually playing the game, over and over again.

Can confirm! Palm devices were generally tested for things like memory leaks by just running them for a really long time.

1 phone call, 1 email per minute… for a week.

I wrote some core dump readers that would look for memory patterns in crashed devices for Palm back in the day, but our QA was largely manual testers. 5-6 QA folks for every dev.

> I'm wondering how to test those thousands lines of C++ code, a lot of them are compute-intensive, I don't see any unit test.

That's not C++ code.

Used that at the time, I've never seen other platforms use that approach.