Monday, October 4, 2010

Tuesday, February 23, 2010

สองเจ้าพ่อแห่ง RV research

คำว่า "เจ้าพ่อ" อ.วรเศรษฐ ท่านพูดถึงใน presentation ของวิชาสัมนา

เราก็คิดว่าบุคคลสองท่านนี้น่าจะตรงกับศัพท์คำนี้ในความหมายของอาจารย์ได้ เลยฝาก homepage ของท่านทั้งสองไว้

เพื่อศึกษางานวิจัยของท่านได้สะดวกยิ่งขึ้น


Klaus Havelund

Eric Bodden

ใครอยากศึกษาข้อมูลเพิ่มเติมก็เชิญได้เลยนะคะ เพราะท่านทั้งสองยินดีมากที่จะเผยแพร่ ((คิดเองรึเปล่าเรา))

Sunday, January 31, 2010

Aspect Oriented Programming (AOP)

AOP เอาไว้แก้ปัญหาเรื่อง Cross cutting concern (เอาให้ง่าย ๆ ก็คือการตัดผ่านเฉพาะสิ่งที่สนใจ)

ตัวอย่างเช่นเราจะทำระบบอะไรสักอย่าง แล้วมี cross cutting concern ที่ตัดผ่านคลาสของเราหลายอย่าง เช่น security logging message, availability ต่างๆ เป็นต้น ซึ่งอาจจะเป็นทั้ง functional หรือ non-function requirement ของระบบก็ได้ค่ะ

แต่ในบางคลาส อาจจะมี แค่ logging แต่ไม่มี security ซึ่งใช้ concern พวกนี้ไม่เท่ากันก็ได้

เวลา implement ด้วยแนวทาง OOP จึงทำให้เกิดปัญหาต่างๆ คือ
- concern เหล่านี้ลากตัดผ่านกระจัดกระจาย ทั่วไปในงานเรา (scattering) บางงานใช้บ้าง ไม่ใช้บ้าง
- โค๊ดของงานเราในแต่ละ modular ยุ่งเหยิง (tangling) เพราะมัวแต่ไปจัดการเรื่อง cross cutting เหล่านี้

เมื่อเป็นเช่นนี้แ้ล้วก็ระบบก็จะมี low cohesive เกิด high coupling ไ่ล่ code ก็ยาก แ้ล้วก็ reuse ได้ยากอีกด้วย

แนวทางใหม่ที่นำเสนอขึ้นนั่นคือ AOP (Aspect Oriented Programming)ค่ะ

ซึ่งจะสร้าง โปรแกรมขี้นมาเป็น AOP เพื่อที่จะเขียนคลาสสำหรับ concern ที่มีการตัดผ่านระหว่างคลาสของระบบเรา
โดยแบ่งออกเป็น Aspect ต่างๆ และเขียนแยกออกจาก core concern แล้วก็สร้างกฎสำหรับบอกว่า แต่ละ Aspect นั้นจะลากตัดผ่านยังไงบ้าง กฎนี้เราเรียกว่า Weaving Rules เมื่อเราทำการ weaving ไปผ่านตัว Aspect Weaver เจ้า Aspect เหล่านี้ก็จะไปลากตัดผ่าน core concern ให้เราเองตามที่กำหนดไว้

อ้างอิง : http://www.blognone.com/node/1426

Tuesday, October 6, 2009

คำสำคัญ

(static)
�� อาจใช้ Tool ช่วยตรวจวิเคราะห์ เอกสารและโปรแกรม code
(dynamic)
�� ใช้ข้อมูลทดสอบระบบและสังเกตผลการทำงาน

event-based อันนี้อาจารย์ ดร.อุษา อธิบายซะเข้าใจเลย
คือเกิดเหตุการณ์ตามเงื่อนไขก่อนค่อยทำ ไม่ต้องเช็คทุกครั้งว่ามีการเปลี่ยนแปลงอะไรไปบ้าง

state-based งงอยู่นาน..ตอนนี้จะงงต่อไปรึป่าว
คือเช็คในเวลาที่มีการเปลี่ยนสถานะ

False Positive
เกิดขึ้นเมื่อระบบได้ระบุว่าการกระทำหนึ่งเป็นการบุกรุกแต่ที่แท้แล้วไม่ใช่

<< เอาไว้ศึกษาก่อนเรียน >>

Common types of computer bugs

* Conceptual error (code is syntactically correct, but the programmer or designer intended it to do something else)

# Maths bugs

* Division by zero
* Arithmetic overflow or underflow
* Loss of arithmetic precision due to rounding or numerically unstable algorithms

# Logic bugs

* Infinite loops and infinite recursion

# Syntax bugs

* Use of the wrong operator, such as performing assignment instead of equality test. In simple cases often warned by the compiler; in many languages, deliberately guarded against by language syntax

# Resource bugs

* Null pointer dereference
* Using an uninitialized variable
* Off by one error, counting one too many or too few when looping
* Access violations
* Resource leaks, where a finite system resource such as memory or file handles are exhausted by repeated allocation without release.
* Buffer overflow, in which a program tries to store data past the end of allocated storage. This may or may not lead to an access violation. These bugs can form a security vulnerability.
* Excessive recursion which though logically valid causes stack overflow

#Co-programming bugs

* Deadlock
* Race condition
* Concurrency errors in Critical sections, Mutual exclusions and other features of concurrent processing. Time-of-check-to-time-of-use (TOCTOU) is a form of unprotected critical section.

# Teamworking bugs

* Unpropagated updates; e.g. programmer changes "myAdd" but forgets to change "mySubtract", which uses the same algorithm. These errors are mitigated by the Don't Repeat Yourself philosophy.
* Comments out of date or incorrect: many programmers assume the comments accurately describe the code
* Differences between documentation and the actual product

[[อ่านที่นี่]]