살군의 보조기억 장치

Another memory device…

Archive for October 2011

UML terminology definitions

leave a comment »

Association: I think, this pics would present the best way for association. As you can see, association illustrates a class has relation with other classes. Source of the arrow includes destination’s object as its attributes.

Aggregation: From Martin Fowler’s UML Distilled 3rd ed., ” Aggregation is the part-of relationship.” Also, “Aggregation is strictly meaningless; as a result, I recommend that you ignore lt in your own diagrams. If you see lt in other people’s diagrams, you’11 need to dig deeper to find out what they mean by it. Different authors and teams use it for very different purposes.” Surely, it may have meaning in some others’ diagrams though, it implies “you need to find further implicit thing in the aggregation symbol.”

Composition: “The general rule is that, although a class may be a component of many other classes, any instance must be a component of only one owner. The class diagram may show multiple classes of potential owners, but any instance has only a single object as its owner.” [UML Distilled 3rd ed. Martin Fowler] Also, “Another assumption is that if you delete the polygon, it should automatically ensure that any owned Points(objects) also are deleted.”[UML Distilled 3rd ed. Martin Fowler]

Generalization: Simply, super-class and sub-class realtion.

Dependency: “A dependency exists between two elements if changes to the definition of one element (the supplier) may cause changes to the other (the client). ” There is two important meanings in the directional arrow of the dependency symbol. When you change the client, the supplier doesn’t get any affect from the modification. Another is there is no direct relation between the client and Data Gateway. So, even if you change something in Data Gateway, there is no direct impact to the client. (Modifying Data Gateway may give some effect to the supplier which would cause the client changing.)

Realization: This is another simple concept to me. Imple mentation of an interface. That’s it.

 

 

Some paragraphs and images are borrowed from Martin Fowler’s UML Distilled 3rd ed. in this article. If there is any problem, please let me know.

Advertisements

Written by gomiski

2011/10/14 at 7:34 am

Posted in Uncategorized

Xcode Unit-Test Result Macro Reference

leave a comment »

Retrieved from: Xcode help page

———————————————————————————————————————-

Important: When the expressions your test cases evaluate throw exceptions, they produce unknown errors. To test whether your code raises exceptions, create test case that explicitly check for the presence or absence or exceptions; see “Exception Tests” below.

 

Unconditional Failure

  • STFail()

Equality Tests

  • STAssertEqualObjects()
  • STAssertEquals()
  • STAssertEqualsWithAccuracy()

Nil Tests

  • STAssertNil()
  • STAssertNotNil()

Boolean Tests

  • STAssertTrue()
  • STAssertFalse()

Exception Tests

  • STAssertThrows()
  • STAssertThrowsSpecific()
  • STAssertThrowsSpecificNamed()
  • STAssertNoThrow()
  • STAssertNoThrowSpecific()
  • STAssertNoThrowSpecificNamed()
  • STAssertTrueNoThrow()
  • STAssertFalseNoThrow()

 

Written by gomiski

2011/10/13 at 12:32 am

Posted in Uncategorized

xcode unit test setup (Logic Test case)

with one comment

From iOS Developer Library, there is two test methods.

  1. Logic test: Unit or Class based test. Mostly, purpose is checking the a single functionality.
  2. Application test: Test whole application.

Assumption: Include Unit Tests checkbox is checked when you create a new project

Setting up Logic Unit Test on Xcode 4.1

To set up a unit-test target to perform logic tests:

 

 

 

 

 

  1. In the project editor, select the unit-test target you want to set up, and display the Build Settings pane.If you don’t have a unit-test target in your project, add one and name it <app_name>LogicTests (where <app_name> is the name of your application), as described in“Adding a unit-test target to Your Project.”
  2. In the Build Settings pane’s scope bar, click All.
  3. In the search field, enter ios deployment target, and press Return.
  4. If the iOS Deployment Target build setting appears in bold, select it, and press Delete.
  5. In the search field, enter bundle loader, and press Return.
  6. If the Bundle Loader build setting appears in bold, select it, and press Delete.
  7. In the search field, enter test host, and press Return.
  8. If the Test Host build setting appears in bold, select it, and press Delete.

Written by gomiski

2011/10/12 at 4:08 am

Posted in Uncategorized

Test Driven Development (TDD)

leave a comment »

  1. 테스트 리스트 만듦 (어떤 테스트를 할 지 결정하는 것… 아이디어 회의시 주로 나옴)
  2. 다음 3~7 단계를 반복
  3. 테스트 리스트에서 테스트 케이스를 하나 선택
  4. 컴파일도 안되는 테스트 코드 작성 (당연 테스트는 안됨, 컴파일이 안되니…;;; )
  5. 대충 고쳐서 컴파일 되게 함 –> 테스트는 당연히 실패
  6. 테스트가 통과되도록 만듦 (테스트가 통과되도록 만드는 것이 목적이므로, 코드에 hardwired 된 로직이 존재해도 상관없음. 가령, 3이라는 리턴값을 요구하는 테스트라면 함수안에 그냥 3을 리턴해도 이 단계에서는 상관없음)
  7. 그런 다음 리팩토링(refactoring)을 시작한다. 리팩토링을 해나가면서 중복을 제거하고 말이 안되는 부분을 하나씩 고쳐나감. 리팩토링은 ‘아주 작은 단위’의 코드 변경이다. 코드가 변경될 때마다 컴파일을 하고 테스트를 돌려서 테스트가 통과되는지를 확인해야 한다. 만일 fail 이라면 잘못된 리팩토링을 했다는 의미가 된다.
TDD cycle

TDD cycle

아래 사이트에서 발췌… 테터툴즈 계정이 없으면 트랙백이 안되서리…;;
사실 어떻게 트랙백 하는지도 잘 몰라서…;;;
http://www.buggymind.com/49

Written by gomiski

2011/10/05 at 1:11 pm

Posted in General, Java, Lecture