PageRenderTime 57ms CodeModel.GetById 46ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/testability-explorer/src/main/resources/messages.properties

http://testability-explorer.googlecode.com/
Properties File | 152 lines | 79 code | 19 blank | 54 comment | 0 complexity | bc6fa168539891cb3f19169510848762 MD5 | raw file
  1###
  2#
  3#  Copyright 2007 Google Inc.
  4#
  5#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6#  use this file except in compliance with the License. You may obtain a copy of
  7#  the License at
  8#
  9#  http://www.apache.org/licenses/LICENSE-2.0
 10#
 11#  Unless required by applicable law or agreed to in writing, software
 12#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 13#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 14#  License for the specific language governing permissions and limitations under
 15#  the License.
 16#
 17###
 18
 19###
 20# US-English message bundle for the testability explorer reports.
 21# It contains some HTML markup, so it's intended to be displayed in HTML.
 22# TODO(alexeagle): we'll probably want to render issues in other contexts, like the CLI or IDE
 23#
 24# @author alexeagle@google.com (Alex Eagle)
 25###
 26
 27
 28report.title=Testability Report
 29report.timestamp=Report generated on: {0,date,yyyy-MM-dd hh:mm:ss}
 30
 31report.explain.linkToWiki=Why is it bad?
 32report.explain.onLine=On line
 33report.explain.aroundLine=\
 34  <acronym title="Java class file format doesn't \
 35  include line numbers for method declarations">Around line</acronym>
 36report.explain.contribution=Contribution<br/>to class cost
 37
 38report.explain.class.hardToTest=Class {0}{1}{2} is hard to test because:
 39
 40###
 41# Hard to test due to construction of the class
 42###
 43report.explain.class.construction=\
 44  It is expensive to construct an instance of the class, and every test will need to call a constructor.
 45report.explain.class.construction.static_init=\
 46  These static initializers will need to be run once, when the class is loaded.
 47report.explain.class.construction.static_init.element={0}static {1}{2} is declared
 48report.explain.class.construction.static_init.suggest=\
 49  Instead of initializing this state statically, try initializing a fresh copy in each instance. \
 50  Creating new objects in Java is cheap, and this static state can't be cleaned up between tests.
 51report.explain.class.construction.static_method=Static methods are called in constructor
 52report.explain.class.construction.static_method.element=static method {0}{1}{2} is called
 53report.explain.class.construction.static_method.suggest=\
 54  This couples every test to use the code in the static method. \
 55  Refactor the static method to be an instance method on the class.
 56report.explain.class.construction.setter=Setters will need to be called by tests
 57report.explain.class.construction.setter.element=\
 58  Setter method {0}{1}{2} may need to be called before some methods can be tested
 59report.explain.class.construction.setter.suggest=\
 60  Setter methods should avoid doing serious work. Instead, the \
 61  initialized state should be passed to the setter.
 62report.explain.class.construction.non_mockable=You are calling <tt>new</tt> in the constructor
 63report.explain.class.construction.non_mockable.element=<tt>new</tt> instance of {0}{1}{2} created
 64report.explain.class.construction.non_mockable.suggest=\
 65  Using new couples this class to the one instantiated, \
 66  preventing you from testing this class in isolation of that collaborator. \
 67  Instead, pass an instance of the collaborator as a new constructor parameter.
 68report.explain.class.construction.complexity=Constructors with a high cyclomatic complexity
 69report.explain.class.construction.complexity.element={0}{1}{2} is complex
 70report.explain.class.construction.complexity.suggest=\
 71  Don't perform work in the constructor. Instead, initialize all the needed state, and pass \
 72  it as a new parameter.
 73
 74report.explain.class.construction.singleton=A singleton is used
 75report.explain.class.construction.singleton.element=mutable global field {0}{1}{2} is declared
 76report.explain.class.construction.singleton.suggest=Don't use singletons. Instead, use a \
 77  dependency injection framework or factory that always returns the same instance.
 78
 79#report.explain.class.staticInit=Static initializers must be run:
 80#report.explain.class.staticInit.variable=a static member variable {0} is initialized to a value that is complex to evaluate.
 81#report.explain.class.staticInit.suggest=Suggestion: these static members are complex. Instantiate the values outside this class, and pass them as parameters to the constructor.
 82
 83#report.explain.class.constructor=The constructor does work:
 84#report.explain.class.constructor.methodExec=in the constructor, {0} is executed, which has a high complexity.
 85#report.explain.class.constructor.suggest=Suggestion: tests will have to execute this code to create an instance. Do this work outside the class, and pass the needed state as a parameter to the constructor. If this is impossible, at least move this code to an initialization method.
 86
 87###
 88# Hard to test due to non-mockable collaborators
 89###
 90report.explain.class.collaborator=\
 91  These collaborators cannot be mocked, so it is impossible to unit test this class in isolation.
 92
 93report.explain.class.collaborator.static_method=Static methods are called:
 94report.explain.class.collaborator.static_method.element=static method {0}{1}{2} is called
 95report.explain.class.collaborator.static_method.suggest=\
 96  Since these static methods are complex, we want to mock them out in the unit test. \
 97  If they are declared in your code, refactor the methods to be non-static, \
 98  and inject an instance of the class. Otherwise, you can create a wrapper object.
 99
100report.explain.class.collaborator.non_mockable=Non-mockable collaborators:
101report.explain.class.collaborator.non_mockable.element={0}{1}{2} is called
102# TODO(alexeagle): figure out which reason is the right one here
103report.explain.class.collaborator.non_mockable.suggest=\
104  This method call can't be mocked out from a unit test because the test cannot \
105  control how the object is instantiated. This can be caused by: \
106  - the object was created using new, \
107  - it was returned by a non-mockable collaborator, or \
108  - the method is declared final or private, which prevents overriding in a subclass
109
110report.explain.class.collaborator.singleton=Singletons are used:
111report.explain.class.collaborator.singleton.element=mutable global state is accessed by {0}{1}{2}
112report.explain.class.collaborator.singleton.suggest=\
113  Don't use singletons. Instead, use  \
114  dependency injection and always inject the same instance.
115
116###
117# Hard to test because of direct costs
118###
119report.explain.class.directCost=\
120  The code itself is complex, and it will be hard to test all the different paths of execution
121report.explain.class.directcost.complexity=\
122  There are complicated methods
123report.explain.class.directcost.complexity.element=method {0}{1}{2} has high complexity
124report.explain.class.directcost.complexity.suggest=\
125  Refactor the method by breaking the complex portions into several smaller methods.
126
127###
128# Hard to test because of mutable global state
129###
130
131###
132# Makes other code hard to test
133###
134#report.explain.class.impactOnOthers=This class may make it hard to test other code that uses it because:
135#report.explain.class.staticVars=Static variables need to be set to the correct state
136#
137report.explain.class.benefits=If these changes were made, the cost of testing this class would be reduced by {0}{1,number,##%}{2}.
138
139
140
141################################
142#
143# The "About Testability" report
144#
145################################
146report.about.title=Examples of how Testability works
147report.about.description=Testability explorer analyzes compiled classes, looking for issues in your code that make it difficult to unit test. \
148  Each class below is an example of a particular bad practice, and is followed by the explanation of the issues that are found in that code. \
149  <strong>To make the examples short, the issues in this code are minor. To demonstrate the report, the sensitivity has been set artificially high.\
150  Normally, these issues would not be reported. </strong>\
151  To create a report like this for your code, see <a href="http://testability-explorer.googlecode.com">the Testability Explorer website</a>.
152report.about.class=Example class: {0}{1}{2}