Question
Assume a developer writes the following source code to concatenate two strings. r the method is used to concatenate too strings into one. It returns
Assume a developer writes the following source code to concatenate two strings. r the method is used to concatenate too strings into one. It returns a string that represents the concatenation of this object's characters followed by the string argument's characters. public String concat(String str) int otherLen str.length0 int len value.length; The expected behavior of the method is to concatenate two strings into one. For example, strings s1 is Joh and string S2 is "Smith". The concat() method will concatenate/combine s1 and stinto a new string S3 John Smith" by the following statement: String s3- s1.concat (s2): Write a unit test to test the method's behavior. Do not discuss the source code of concat(). The unit test will . test the behavior/outcome of the method no matter how it is programmed. You may write the unit test using any of the following ways: 1) any programming languages, or 2) pseudo code, or 3) English statements, or 4) combination of the above. The unit test must clearly list the steps of how it tests the behavior of the concat) method.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started