Details
Joined devRant on 2/25/2017
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
@netikras
I am, of course, aware of that. However, LoC/SLoC count is at least a basic size measurement.
In our case, we have roughly
- 9000 unit tests
- 200 integration tests
- 60 UI tests
(Client - Server application)
I've seen with tests running 400 hours, or even 2 weeks. I'm more interested in the order of magnitude you'll find "in the wild" ;-) -
@alexbrooklyn thanks for commenting! any insights on system size?
-
Generally, testing for something that will only go wrong under very rare circumstances might just be too much effort (considering the actual benefit of that particular test).
So instead, maybe simply review the error handling code once more and call it a day.
There will almost certainly be more critical tests to write ;) -
Out of curiosity: how long does the Pipeline take?
-
I mostly don't follow TDD strictly, but I strongly believe that writing tests should be a fundamental task for every professional software developer.
Why? Because it will enable you to refactor your code, and to add new functionality without breaking things. So, adding tests (and, mind you, _fast_ tests) is an investment in the quality of your product.
Having said that, adding tests for trivial functions is a waste of time. In addition, enforcing a certain threshold for the test coverage is stupid and may in fact be harmful.
Regarding "testing your tests": mutation testing is what you should do ;) -
Me too! :-)
-
Get out there as soon as you can.
Mind you, even in professional software development it will always be hard to estimate how long some new feature will take. And that is when asking the person who arguably knows the code best (you!).
You're not working professionally (because they won't let you), and they push down their unrealistic schedules, which means THEY don't do their job. Don't let them get away with this. -
Removing code! :) :)
-
It's actually a surprisingly hard problem to figure out whether a given string is a valid URL, especially with all the new top level domains floating around.
Same applies for email addresses ;) -
Well, ideally, you run your unit tests after each Refactoring step and check if things still work.
But of course, this has happened to me, too ;) -
Clean code is a good start!
Be sure to watch "Uncle Bob's" talks on YT, too, they are quite insightful.
In addition, I'd recommend to let a tool help you to write clean code and improve your code over time (there are many!). My company (and I ;) are working on a code quality tool called "Teamscale" which is free for students. Let me know if you're interested ;) -
Haha :-D
-
If you don't mind, two small things from a "reviewer's perspective":
- the inner if-block can be simplified by switching if and else (the ! Is not needed)
- is the surrounding check really needed? (the position would be unchanged in the 0-case IISTC ). If the check really needs to be there, it could -depending on the sounding code- be possible to use an early return to reduce nesting depth ;) -
I think the main misunderstanding about unit tests (and TDD for that matter) is HOW to write unit tests.
It you start with something like
testConstructor(), then you are most likely on a wrong path.
Also, if your unit tests need to start a database server first, then there is definiciones something wrong.
Unit tests should be:
- fast
- specific
- failable (!)
And test code should be a first class citizen, too!
If seen the benefits in practice, so I think I know what I'm talking about ;) -
Dell XPS 15, Intel i7, 32 GB of RAM, 4k Display, 1 TB PCIe SSD
Visual Studio is still slow :p -
CTRL + S Saves and auto-formats the current file (I set this up for all IDEs I use)
CTRL + shift + R Open file by name. (Eclipse and Intellij with "eclipse keymap")
CTRL + Space. Auto complete
Alt +Enter. Quick fix (e.g. generate method) how did I survive without this?!
F2 Rename variable/file (Visual Studio with Reshaper, but I enabled this in every IDE I use) -
@bittersweet good points, some of them sound very familiar. thanks for the additional info!
-
@bittersweet that sounds fairly reasonable, considering the sheer size ;)
Personally, I try to follow the "boyscout rule" (leave the camp cleaner than you found it) to improve over time (easier said than done obviously ;) -
Sounds like this system will be running for decades ^^
In fact, one of my personal"lessons learned" in university is that there are software systems like this one, which have been running for decades and can't simply be switched off ;)
Just out curiosity, do you have some kind of (code) quality control mechanism in place? -
Random knowledge:
The original meaning of '666' was "Nero" (the Roman emporer), as this was originally written in a language where digits could be interpreted as characters (I think it was Greek, but not sure)
But this double meaning was lost in translation, obviously. So there is nothing special about this number :-) -
@BindView interestingly, I agree with both you and the OP ;)
Let's just say there is room for improvement, but it seems to me that MS is on it. -
I highly recommend watching a couple of talks by "Uncle Bob" (the author), it's worthwhile! (Even though I don't agree with everything he says)
-
.
-
@billgates that's a pretty interesting question!
I've seen a ton of open source projects with really bad (code) quality, so I can only hope that nobody considers them a "role model".
The more abstract code you mentioned has _probably_ higher code quality, but one has to really dive into the source code to understand how things work. Disclaimer: Code with abstractions and interfaces can be really really bad, too ;)
You can't have it both ways I guess... -
@jamescodesthing exactly, method length and clone coverage (amount of copy-D code) say a lot about the quality of a system IMHO
-
Ahh, I know the feeling! :-)
-
Excellent points!
In particular, I agree that paying an instrument can help a lot.
The only thing I'm missing is taking a shower ;-) -
Any sources for the claim that the stories get "filtered"?
I agree that there is a need for reforms. However, I still prefer these channels if the alternative is something like Fox "News" -
@spongessuck my bad, again ^^
Our software connects to the version control systems of customers, reads in their code and performs all kinds of useful analyses. For this to work, we have parsers for a whole bunch of languages.
And I was sitting there for a good amount of time, trying to figure out what's wrong with one of the parsers, while the reason was simply that the particular file wouldn't even compile :-p
(To be fair, it was a very subtle mistake (braces) in a very long method, so hard to spot for me) -
@kgbemployee see my last comment ;)