|
That is a bold statement.
One can easily test all DBConnection classes over their interface; input, behaviour and result can be verified, doesn't require a human. The corrected statement here is that you do not see the value yet.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Two issues with that
1) If your database access is done through the likes of EF then all you're doing is testing Microsoft's code, not your own.
2) Testing database activities has no place in unit tests so the whole argument is moot.
|
|
|
|
|
F-ES Sitecore wrote: 1) If your database access is done through the likes of EF then all you're doing is testing Microsoft's code, not your own. Then you are doing it wrong. You don't test whether Microsofts code works, you test whether you get the result you expected.
F-ES Sitecore wrote: 2) Testing database activities has no place in unit tests so the whole argument is moot. Automated testing should be all in the same place; and yes, one can test the database-activities by code.
You rather test by hand?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You clearly don't understand unit testing. Making statements like "you do not see the value" and "you are doing it wrong" should really be reserved for when you understand the subject matter. Saying those things doesn't make you right.
|
|
|
|
|
F-ES Sitecore wrote: You clearly don't understand unit testing. Ah, that must be it. Well, that was a short discussion
For what it is worth; any code can be tested in an automated way. You can choose to, or not to
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Don't feed the @+O== !
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Abso-bloody-lute tosh and drivel!
Automated testing is great, even outside TDD environments. I like to have regression tests built-in so that whenever code is checked in, it is automagically built and tested. You know straight away if your new code has negatively impacted the existing code base.
Given the right tools, you can even auto-test front ends.
veni bibi saltavi
|
|
|
|
|
We're talking about automated generation, not execution. Unit tests by their very nature are executed automatically.
|
|
|
|
|
For legacy apps I'd love to be able to click an easy button and generate a full regression test suite before starting to elephant with stuff.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Then all you're testing is that the code you have does what it currently does....but you know it does, that's a tautology.
public int Add(int x, int y)
{
return x + x;
}
The above code has a typo, it should be x + y, but my auto-generated tests are going to test;
public void TestAdd()
{
int addResult = Instance.Add(5, 8);
Assert.AreEqual(10, addResult);
}
I see no value in this at all, it takes a human being who understands the *intent* of the code to write valid tests.
|
|
|
|
|
F-ES Sitecore wrote: Then all you're testing is that the code you have does what it currently does
Exactly. I called them regression tests for a reason. Knowing I didn't change any other behavior unintentionally is the entire point. The application is very well covered via a manual pound on the keyboard test procedure. It also takes 1-2 weeks for a person to run through because it's so exhaustive. With the application currently only getting a trickle of keep alive funding, not having to spend a third or more on testing would be a major cost efficiency boost; but we can't cut the test procedure down without something to replace it. And we don't have anything approaching the amount of money that would be needed to do the massive refactor that would be needed to change the code into something that would place nicely with unit tests and then find all the regression bugs we created in the process.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
|
I don't suppose you know anything decent for WinForm UI testing?
By decent, I mean something that I can click and type on the UI to generate the initial script (elephant you TestStack.White) and stable enough that I don't spend half my time reinstalling it because it suddenly stopped working (elephant you too ir Ratonal dys Functional Tester of patience ).
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
shrknt35 wrote: and it dose not look mature enough. Please explain; what are you missing, and when would you consider it "mature enough"?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: when would you consider it "mature enough"?
Simple : When I run intellitest, it runs well enough, create lots of test cases, but when I save them, it confuses some of classes with same name as some .net classes and do not even provide a way for me fix it : thus not mature enough.
Now, I know I probably should avoid such names, but it's a legacy code.
|
|
|
|
|
Add the namespace; it would no longer be confused. I don't think MS will consider that a problem; no software works if it cannot determine which class to use.
Meaning, it will probably not mature on that specific area.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I played around with it over xmas/newyears break last year, it seemed like it might be useful with greenfield development to help make sure you're covering all the bases. It was nowhere near ready to meet its hyped ability to generate a regression test suite for legacy code.
Major limitations I found were:
0) Ignored all methods in a winform class that touched a UI element. IOW if your legacy app has significant logic in OnClick() events you're still elephanted when it comes to testing.
1) If you've got any static/global state it can't figure out how to initialize it (or even that it needs to). Again, meaning you're probably elephanted with a legacy app.
2) Total faceplant for anything touching the file system that relies on function input. It's automated parameter generation to try and find a working path will pass "a", "b", "c", etc to File.Open() etc until it gives up after a jillion futile attempts. Your legacy app that didn't abstract the file system away, yeah you're elephanted again.
The app I played with didn't do any DB access; but based on what I saw I'd be shocked if it didn't try connection strings of "a", etc until it gave up; again being elephanting useless. Didn't test WPF either; but to the extent that you didn't drink the data binding koolaid and make a thin brainless UI class you're presumably elephanted again.
The Beta UI also made getting the test cases it generated into unit test files rather klunky. If you were using it to verify your test coverage as you went it wouldn't be too bad; but it'd make trying to get a full test suite in place a PITA even if you had an easily testable codebase.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
None of those are issues. Your unit tests shouldn't touch UI (winforms UI is inherently non unit testable, as is the session\cookies\etc\etc in a website), or the filesystem, or database connections. Unit tests are *not* integration tests, end-to-end tests, UI tests or anything else...they are for unit testing small functions of code, and not all code is unit testable. If your code is behind a click event it is untestable, if it references a textbox it is untestable, if it touches *any* resource not in its immediate environment such as file system\database\asp session\etc it is untestable.
If you want your code unit-testable it normally takes a large amount of time and effort and specific architectural patterns such as abstracting away file systems etc, for it to be achieved. The reason the tool is ignoring your code is actually correct...that code can't be unit tested.
|
|
|
|
|
Automated tests are automated tests.
What level they run at is just arguing over how many angels can dance on the head of a pin. Insisting that because 5 angels can dance on this pin, 9 on that one, and 23 on some other pin; means that you need to use three different tools with three different syntaxes to test them is even more assinine. If some of the high level tests take significantly longer to run, split them off and normally only run them on the CI server (at checkin or even just nightly is really huge); but there's no reason not to use the same tools to write and run them.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
This thread is about unit tests, though. I think people are getting confused with the "automated" part in the thread title. It is the *generation* that is automated, not the execution.
Also there are many reasons to use different suites to run different kinds of tests, but that's not particularly relevant to this thread.
|
|
|
|
|
Thanks man that's really helpful.
|
|
|
|
|
After yet another dismal British summer (link[^]), I've been thinking about whether to have a go at working abroad (which includes moving the family out with me ).
I'm considering the US, Canada and New Zealand (Australia would be too hot for my delicate British nature), but thought I'd ask people from those parts what it's really like to work in software and what the general lifestyles are like? Where are the best regions to find work and nice places to live?
If there are any Brits that have moved already, how do things compare with the UK?
It's difficult to get a realistic view from the internet (does that surprise anyone?) - it's either everywhere abroad is awful, or everywhere abroad is paradise - so I thought I'd ask here
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
If you hate British summers, I would recommend you to give northern Alaska a try. Maybe what you have is not all that bad!
Life is too shor
|
|
|
|
|
I did do a couple of years in Russia, it was quite nice in winter. -40C, snow everywhere, interesting to see people skiing to work
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
Like everything in this world most places have advantages and disadvantages. First you need to understand what sort of lifestyle you are after as that has a bearing on the location, weather and local culture.
Not that I'm pushing Aussie, but you have to remember it is a large place from the tropics to Tasmania in the south with weather to much the extremes.
|
|
|
|