Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:26:20+00:00 2026-06-11T12:26:20+00:00

BACKGROUND I’m writing a little game using Java, slick2d and other frameworks. Slick2d does

  • 0

BACKGROUND

I’m writing a little game using Java, slick2d and other frameworks. Slick2d does not make it easy to write unit tests, but that’s something I can’t get around. One of the goals of the project was to have some test coverage but…

THE PROBLEM

Well… I wrote a 200-line test case, with 15 tests, and all for a class with only a single method.

I tested everything I could think of: invalid arguments, combinations of invalid arguments, swapping method calls and so on. I know I can’t test everything, and I know I don’t need to test code from libraries (Java API, slick2d API, logback API, etc.), but even in that case, I can get pretty crazy with tests, and I believe that I won’t be able to finish it if I write 15 tests for every method I create. So…

THE QUESTION

Where does good TDD draw the line at writing tests? Exactly what should I test, and what can I safely ignore?

OBS: For those of you wondering, the single-method class for which I wrote 15 tests was loading some strings into an array, and its method would retrieve the string, given the line and file as argument.

OBS2: I’m not skeptical of unit testing at all. I actually want to incorporate them in my project (whenever my API allows me) from the ground up. I just want to finish the project too, and don’t die writing tests all day long.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:26:21+00:00Added an answer on June 11, 2026 at 12:26 pm

    I would suggest the following book: http://www.amazon.com/dp/0321146530/?tag=stackoverfl08-20
    from Amazon
    Beside the book recommendation, When you design your tests, you have a lot of work at the beginning, but at a point, for every new code, most of your test logic will already be on place.
    I would also suggest to make sure you are focused on intrusion prevention as well (code that test for SQL injection, buffer ovf and so)
    Another point to remember is that when the one who wrote the code is the one who wrote the tests, you might want someone else that will try to break it down… not for everything, but at least for part of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I am writing and using a very simple CGI-based (Perl) content management tool
Background: I am writing a flash game and have encountered a problem. I have
Background: I'm using the (fantastic) Vim plugin python-mode , which includes the pep8 linter.
Background - I am using paramiko to put files on a bunch of remote
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background I am writing code in VS 2010, .NET 4, C#. Also, in case
Background: I'm testing a function within an ASP.NET 4.0 (Web Forms not MVC) and
Background info: Me and a couple of friends are building this platform game in
BACKGROUND I'm using VS 2010 on a machine where I installed .Net 4.5 which
Background: I am using Eclipse to develop an Android app. I have an xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.