Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# UnitTesting
Is it preferred to use the real UI or should it be mocked in AAT? Currently, i mock out my view for my unit/integration testing, but should i for automated testing? I can't seem to find any articles about this online. Mostly relates to Unit-testing specifically.
Posted 22-Oct-12 6:47am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Those are just different tests, and you need both, to improve your chances to reveal some flaws. The more the better. That would be enough to wrap up the complete answer, but let's think what would be the background of these two different approaches.
 
The application has some inner layers (data layer, business, whatever) and the UI. To put it simple, some universal part functionality (libraries), application-specific layers with application-specific data model and business layer are inner layers, and UI just on top of it. You can have some flaws on inner layers which might be polished out on the UI layer: some functions are never called, or called only with more limited set of parameters. That may hide some actually existing problems in inner layers. So, testing with "real" UI won't reveal these problems. But apparently, you need to make all layers. First and foremost, unit testing on each of the layers should address it, but there is no such thing as comprehensive testing. So, "mocked UI" testing can put more tests which are closer to the real-life situation, but not limited to the set of test cases available with the "real" UI.
 
At the same time, all of the above might not be enough, because your "real" UI layer itself can have bugs. Automated testing with the "real" UI give you the chances to reveal them, too.
 
This way, all kinds of tests are not completely alternative to each other, they are rather complementary. I hope this example of logical reasoning can help you to evaluate testing scenarios to devise more effective test plans.
 
One final note: this is not alpha or beta testing, this is the testing performed as a part of development process. You should focus on those aspects of testing where you get the most benefits of this involvement: having all the knowledge on the system architecture, code design, even on particular skills or downsides of each individual developer, you can identify the most potentially problematic aspects and put more focus in on them in you test plans. Your question is related to only a small but essential part of this.
 
—SA
  Permalink  
v9
Comments
Nelek at 22-Oct-12 13:13pm
   
Nice answer
Sergey Alexandrovich Kryukov at 22-Oct-12 13:19pm
   
Thank you, Nelek.
--SA
Nelek at 22-Oct-12 13:30pm
   
You are welcome
Blakej777 at 22-Oct-12 14:29pm
   
Thanks!
Sergey Alexandrovich Kryukov at 22-Oct-12 14:36pm
   
You are welcome.
If you agree that it makes sense, please accept the answer formally (green button) -- thanks.
It won't block you from having advice on this page from other members.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 22 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100