Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
For each feature, Developer needs to clearly understand the feature and its functional
requirement. (Output: Java interface with its functions signature (all the methods, method
name, arguments and return types))
User Story: Write a software that checks if the inputted string is a palindrome or not.
Requirement Analysis:
What is a palindrome?
What if the word or phrase contains any special character? Like in “Madam, I'm Adam”
Business Analyst or the customer has confirmed that these scenarios also need to be implemented.
Design phase begins... (Functional or Technical design for the feature with respect to the overall existing
architecture need to be addressed now).
We should say whether the input is Palindrome or not (Return type Boolean)
We should also need to remove special characters (if any) and return the text without special characters
– new method is required, Parameter is String and its Return type is also a String
So, the order is to remove the special characters first and then check if the text is a palindrome or not.
Java Interface:
interface PalindromeInterface{
public String removeSpecialChars(String input);
public boolean checkPalindrome(String input);
}
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Collection;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class PalindromeTest {
private boolean expected;
private String palindromeText;
Implementation:
package com.oracle.Programs;
import java.util.Scanner;
return true;
}