Timeline for How do you unit test private methods?
Current License: CC BY-SA 3.0
27 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 16, 2023 at 13:58 | answer | added | Maarten Bodewes | timeline score: 1 | |
| Jul 27, 2021 at 17:23 | answer | added | Dave Cousineau | timeline score: 1 | |
| May 19, 2020 at 22:12 | answer | added | gnasher729 | timeline score: 1 | |
| May 19, 2020 at 22:07 | comment | added | gnasher729 | @Rig: If you can break the public method, it suddenly really matters what the private methods are doing. | |
| May 18, 2020 at 17:55 | answer | added | Rui | timeline score: 6 | |
| Feb 24, 2020 at 18:28 | comment | added | frederj | This article was useful for me enterprisecraftsmanship.com/posts/unit-testing-private-methods | |
| Apr 12, 2019 at 21:30 | comment | added | sepehr | Never gets old. | |
| Mar 17, 2019 at 0:30 | comment | added | Scott | Use @Jailbreak from the Manifold framework to directly access private methods. This way your test code remains type-safe and readable. Above all, no design compromises, no overexposing methods and fields for the sake of tests. | |
| May 28, 2015 at 14:21 | history | tweeted | twitter.com/#!/StackProgrammer/status/603929048083996672 | ||
| May 28, 2015 at 10:40 | comment | added | James Anderson | @Rig -- +1 -- you should be able to invoke all the required behavior of a private method from your public methods -- if you cannot then the functionality can never be invoked anyway so there is no point in testing it. | |
| May 28, 2015 at 10:36 | history | protected | gnat | ||
| May 28, 2015 at 10:08 | comment | added | overexchange | Both public and private methods should be tested. Hence, a test driver generally needs to be inside the class it tests. like this. | |
| Feb 5, 2014 at 7:04 | review | Close votes | |||
| Feb 6, 2014 at 17:07 | |||||
| Feb 5, 2014 at 3:07 | answer | added | agrawalankur | timeline score: 11 | |
| Jan 31, 2014 at 12:10 | answer | added | Gustavo Coelho | timeline score: 21 | |
| Dec 13, 2013 at 10:52 | answer | added | gyorgyabraham | timeline score: 12 | |
| May 9, 2013 at 9:16 | answer | added | spaceman | timeline score: 3 | |
| Apr 10, 2013 at 20:44 | answer | added | Roger Keays | timeline score: 2 | |
| Nov 27, 2012 at 10:43 | answer | added | Richard | timeline score: 52 | |
| Nov 27, 2012 at 9:45 | answer | added | kij | timeline score: 3 | |
| Apr 12, 2012 at 18:22 | comment | added | rlperez | My opinion has always been that private methods don't need testing as you should be testing what is available. A public method. If you can't break the public method does it really matter what the private methods are doing? | |
| Apr 12, 2012 at 18:19 | answer | added | Budda | timeline score: 10 | |
| Dec 28, 2011 at 11:21 | vote | accept | Vinoth Kumar C M | ||
| Aug 14, 2011 at 8:18 | answer | added | quant_dev | timeline score: 170 | |
| Aug 14, 2011 at 5:40 | answer | added | Adam Lear♦ | timeline score: 360 | |
| Aug 14, 2011 at 5:02 | comment | added | Chiron | Check this question on StackOverflow. A couple of techniques are mentioned and discussed. What's the best way of unit testing private methods? | |
| Aug 14, 2011 at 4:44 | history | asked | Vinoth Kumar C M | CC BY-SA 3.0 |