What is a C programming

What is a C Program? | Detailed Explanation of C Tokens and Identifier Rules 💻 What is a C Program? A C program is a computer program written in the C programming language , which is a general-purpose, powerful, and fast low-level language. It was developed by Dennis Ritchie in 1972 at Bell Labs to create the Unix Operating System . C is the foundation of many modern programming languages such as C++ , Java , and Python . C is a powerful and efficient language — it allows direct control of memory and is ideal for creating high-performance software. ✨ Key Features of the C Language: Fast execution Efficient memory management Modular programming support Portable across platforms 🧠 Example of a Simple C Program: #include <stdio.h> int main() { printf("Hello, World!\\n"); return 0; } This program simply prints “Hello, World!” on the screen. 🔹 What are C Tokens? When writing a C program, each statement is made up o...

Android testing & Debugging

Android Testing மற்றும் Debugging

Android Testing மற்றும் Debugging

அறிமுகம்

Android அப்ளிகேஷன் உருவாக்கும் போது Testing மற்றும் Debugging முக்கிய பங்காற்றுகின்றன. பிழைகளை விரைவில் கண்டுபிடித்து சரிசெய்வது, தரமான அப்ளிகேஷனை வழங்க உதவும்.

Debugging Basics

  • Logcat: System messages, exceptions, logs அனைத்தையும் பார்க்க உதவும்.
  • Breakpoints: Code execution-ஐ இடைநிறுத்தி variable values பார்க்கலாம்.
  • Step Execution: Code-ஐ வரிசையாகச் சோதிக்கலாம்.
// Example: Debug log
Log.d("MainActivity", "Button clicked: " + buttonId);

Unit Testing (JUnit)

Unit testing மூலம், ஒவ்வொரு function/class எதிர்பார்த்தபடி வேலை செய்கிறதா என்று சோதிக்கலாம்.

// Example JUnit test (Java)
public class CalculatorTest {
    @Test
    public void addition_isCorrect() {
        assertEquals(4, 2 + 2);
    }
}

UI Testing (Espresso)

Espresso framework-ஐ பயன்படுத்தி, UI elements (Button, TextView) சரியாக வேலை செய்கிறதா என்று automated test எழுதலாம்.

// Example Espresso test (Kotlin)
@Test
fun testButtonClick() {
    onView(withId(R.id.button))
        .perform(click())
    onView(withId(R.id.textView))
        .check(matches(withText("Clicked!")))
}

Integration Testing

Modules, APIs, Database அனைத்தும் சேர்ந்து சரியாக வேலை செய்கிறதா என்று சோதிக்க Integration Testing உதவும்.

Common Errors & Solutions

  • NullPointerException: Variable null-check செய்ய வேண்டும்.
  • Network Errors: Internet permission & try-catch சேர்க்க வேண்டும்.
  • UI Crashes: Main thread-ல் மட்டும் UI update செய்ய வேண்டும்.

Pro Debugging Tips

  • Gradle build errors-ஐ log படித்து புரிந்து கொள்ளுங்கள்.
  • StrictMode-ஐ enable செய்து performance issues கண்டுபிடிக்கலாம்.
  • Crashlytics போன்ற tools-ஐ பயன்படுத்தி production crash reports பெறலாம்.

இந்த பதிவு Android Testing & Debugging கற்றுக்கொள்ள ஒரு அடிப்படை வழிகாட்டி.

Comments

Popular posts from this blog

Offline ai

Termux comment

Chat GPT prompt style