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 4058652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:06:23+00:00 2026-05-20T15:06:23+00:00

Has anyone come across an SVN pre-commit hook that works with the following logic?

  • 0

Has anyone come across an SVN pre-commit hook that works with the following logic?

If “MyClass.java” has been modified and is being committed, then there must also be a modification to “MyClassTest.java”, by naming convention.

The goal here is to make sure that a developer made changes to the corresponding unit test, when s/he changed a piece of code.

I know this can be cheated by simply changing a little bit of formatting. But the goal is not to stop cheating. It is to very strongly encourage test driven development in a team that is moving to it.

A bonus would be, for when the change is just a refactor, for the hook to ignore the check if the submit comment has the word “REFACTOR”. (after all pure refactors should always be committed by themselves)

  • 1 1 Answer
  • 3 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-05-20T15:06:24+00:00Added an answer on May 20, 2026 at 3:06 pm

    If what you want to achieve is an “enforcement” of unit testing, I suggest checking in the post-commit (test do run slower than the usual commit operation) if the test coverage decreased for any class. even more, put that check in your Continuous Integration server.

    Of course, this may lead to “stupid” test of get and set just to get more coverage. This can be “prevented” by assigning a coverage threshold and alert only if the threshold is reached.

    This way you can sell the team the idea of a “mechanism to alert us if we make a mistake” instead of “a mechanism to punish you if you do wrong”.

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

Sidebar

Related Questions

Has anyone come across a software that can dynamically stream an arbitrary source identified
I'm wondering if anyone has ever come across a plug-in for mootools that will
Has anyone come across a script / cl app written in any language that
Has anyone come across an error like the following: Unable to cast object of
Has anyone come across a Perl module that will parse (and write) kerberos configuration
Has anyone come across any good tools (preferably but not necessarily FOSS) that can
Has anyone come across the need to have a constraint that is only applied
Has anyone come across any open-source projects that take RSS feeds and display then
Has anyone come across an OS X menu bar app that when clicked, drops
Has anyone come across this issue before?

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.