DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Quiz: What’s the Best Test Method Name?

Quiz: What’s the Best Test Method Name?

Jakub Holý user avatar by
Jakub Holý
·
Dec. 14, 11 · Java Zone · Interview
Like (0)
Save
Tweet
5.25K Views

Join the DZone community and get the full member experience.

Join For Free

which of the following names of test methods do you think to be the best?

the best test method name:




vote view results
share this polldaddy.com
quantcast

(notice that we could leave out “payment_” from the last name if it is clear from the context, i.e. from the fixture [a fancy name for test class] name.)

according to the holy book of clean code , the code should make visible the intent as much as possible. according to the testing guru kent b., a test should be telling a story to its reader – a story about how the code should be used and function. according to these two and my own experiences from reading a lot of (test) core written by other people, the last one is absolutely the best. however you have the right to disagree and discuss :-)

ps: i firmly believe that calling a test method “ test() ” should be punishable.

source: http://theholyjava.wordpress.com/2011/12/13/quiz-whats-the-best-test-method-name/

Test method Testing

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Common Types Of Network Security Vulnerabilities In 2022
  • What Developers Need to Know About Table Partition Pruning
  • Quantum Computers Explained
  • 3 Best Tools to Implement Kubernetes Observability

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo