teleren/devto huggingface dataset:
100% Code Coverage is a Lie 🎯
Tags: testing, webdev, programming, tutorial
Published: 2023-02-09 18:20:00

On a project I finally hit 100% Code Coverage 🎯 what could go wrong now? I tested ALL lines of my code, there are no bugs! Well... not really.

If your only goal is having high coverage, you're probably doing more harm than good, wasting time on near-to-useless tests just to see the green coverage report. And bugs might still be there.

Imagine adding tests for simple getters and setters or an empty constructor with no logic. Do they increase the coverage? Yes. Do they add value? Nope.

The goal of tests is to ensure that the code works as expected, not to increase the coverage. If you're not testing the business logic, you're not testing the code. Many projects have to meet certain coverage thresholds, which might make sense if you see it as an enforcement tool to ensure tests are written, but it doesn't have to be the goal or the only thing that matters.

Sure, if you validate that certain lines are tested it's better than not having them tested at all, but as long as edge cases are not covered, that coverage metric isn't worth much.

Those reports should be used instead as a metric to indicate which parts of the code might need more testing. Once identified, forget about the % and write robust tests on the business logic, including possible edge cases.

Beware: **Code Coverage is a tool, not a goal**.

---

If you're curious to hear more about my opinion on Code Coverage, I recorded a video and you can find it on YouTube!

{% youtube WxoSoxVgyUw %}

---

As a bonus content, to further explain the concept, there's a joke on this tweet that makes it really easy to understand:

![Tweet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uqxis2kvcg9lle0z4chp.png)


Code coverage is not enough and edge cases are not enough still. You need to test the business logic, not the code. Coverage will come naturally.

---

What do you think about code coverage? Do you like having coverage thresholds in projects? How high? Let's discuss in the comments!

---


Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me ❤️
You can find it here:
[![YouTube](https://img.shields.io/badge/YouTube:%20Dev%20Leonardo-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UC-KqnO3ez7vF-kyIQ_22rdA?sub_confirmation=1)

Feel free to follow me to get notified when new articles are out ;)
{% embed https://dev.to/balastrong %}
Deploy Nginx "Hello World" App using Docker
Tags: docker, nginx, cloud, cloudskills
Published: 2023-02-09 18:03:22

Here is a step-by-step guide to deploy a Docker Nginx "Hello World" app:


1. Install Docker on your machine. You can find the installation instructions for your operating system at the official Docker website.

2. Create a new directory for your app and navigate to it in your terminal.

3. Create a new file named "Dockerfile" in this directory and paste the following content:

```
FROM nginx:alpine
COPY index.html /usr/share/nginx/html/

```


4. Create an "index.html" file in the same directory with the following content:

```
<!DOCTYPE html>
<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

```
 
5. Run the following command in your terminal to build the Docker image:

`docker build -t hello-world-nginx .
`

6. Run the following command to start a new container based on the image you just built:

`docker run -p 8080:80 hello-world-nginx
`
7. Visit http://localhost:8080 in your browser to see the "Hello World" message displayed by Nginx.

That's it! You have successfully deployed a Docker Nginx "Hello World" app.
How dynamics 365 CRM benefits Business
Tags: crm, microsoftcloud
Published: 2023-02-09 12:48:26

How dynamics 365 CRM benefits Business


Dynamics 365 CRM is a powerful tool that can benefit businesses in a variety of ways. Here are a few key benefits of using Dynamics 365 CRM for your business:


**Improved customer engagement**: Dynamics 365 CRM allows businesses to easily track customer interactions and interactions history. This information can be used to create personalized marketing campaigns and improve the overall customer experience.

**Increased productivity**: Dynamics 365 CRM streamlines various business processes, such as sales and marketing, by automating repetitive tasks and providing real-time data. This allows employees to focus on more important tasks and increases overall productivity.

**Better decision-making**: Dynamics 365 CRM provides a wealth of data and insights on customers and sales performance. This information can be used to make informed decisions ab
out where to focus resources and how to improve business operations.

**Increased revenue**: By improving customer engagement, increasing productivity, and making better decisions, Dynamics 365 CRM can lead to increased revenue for businesses.

**Data security**: Dynamics 365 CRM offers robust data security features and compliance with industry standards such as SOC2, PCI DSS, and ISO 27001.

**Integration with other Dynamics 365 apps**: Dynamics 365 CRM can be integrated with other Dynamics 365 apps, such as Dynamics 365 for Sales, Dynamics 365 for Marketing, and Dynamics 365 for Finance and Operations, to create a comprehensive business management solution.

**In conclusion**, [Dynamics 365 CRM ](https://www.zelitesolutions.com/microsoft-dynamics-365-crm/)is a powerful tool that can help businesses improve customer engagement, increase productivity, make better decisions, and drive revenue growth. With its built-in security and integration capabilities, Dynamics 365 CRM can also help businesses streamline operations and keep data secure.
The Adventure Through the Clouds
Tags: cloud, cloudskills, cloudnative
Published: 2023-02-09 17:26:16

Hello those out there in the cloud-o-sphere! Welcome to my blog! 
I will use this blog to document some of my current ongoing projects using cloud, and to also track my own journey as I develop my love for the cloud.
If you're interested, please join me in this adventure through the clouds!
How to conduct an interview for hiring best Salesforce implementation partner?
Tags: webdev, crm, programming
Published: 2023-02-09 17:25:39

When interviewing for the [best Salesforce Implementation partners](https://www.cloudycoders.com/salesforce-implementation.php), be sure to ask about their experience with Salesforce implementations in your industry, and get a detailed proposal outlining their proposed approach to your project.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rhn6t3qcwzakui8wusoy.PNG)
Talking About Linked List Traversal in JavaScript
Tags: javascript, datastructures, beginners, webdev
Published: 2023-02-09 17:12:22

We practice coding data structures regularly. However, how often do we talk out loud about what the code is doing? I realized this was an area I was lacking in when I was asked to explain a Linked List traversal without coding it. I have wrote some form of the code block below many times, this time I am going to talk about what I am doing in the code block.  

```
class Node {
  constructor(data, next = null) {
    this.data = data;
    this.next = next;
  }
}

class LinkedList {
  constructor() {
    this.head = null;
  }

  traverse() {
    let currentNode = this.head;
    while (currentNode) {
      console.log(currentNode.data);
      currentNode = currentNode.next;
    }
  }
}

const linkedList = new LinkedList();
linkedList.head = new Node(1, new Node(2, new Node(3, new Node(4))));

linkedList.traverse(); 
// output ->  1 2 3 4
```

**Traversing a Linked List in JavaScript Without Using Code**

A linked list is a data structure where each element is linked to the next element in the list. In this post, we will explore how to traverse a linked list without using code. This will help us understand the concepts and logic behind linked list traversal and help us write and explain our own code later.

***Understanding the Structure of a Linked List***

A linked list is made up of nodes. Each node in a linked list has two parts: the data and the pointer. The data part stores the actual value of the node and the pointer points to the next node in the list. The last node in the linked list has a pointer that points to null, indicating the end of the list.

***What is a Linked List Traversal?***

Linked list traversal is the process of visiting each node in the linked list and processing its data. The traversal starts from the first node and ends at the last node.

***How to Traverse a Linked List?***

To traverse a linked list, you need to start from the first node and follow the pointers until you reach the end of the list. The steps are:

- Create a variable, let's call it "currentNode," to keep track of the current node that you are processing. Set its value to the first node in the list.
- Write a loop that continues until the "currentNode" is equal to null.
- In the loop, process the data of the current node.
- Move to the next node by updating the "currentNode" to be equal to the next node, which is stored in the pointer of the current node.

By following these steps, you will visit each node in the linked list and process its data.

**Summary**

Linked list traversal is the process of visiting each node in a linked list and processing its data. To traverse a linked list, you start from the first node and follow the pointers until you reach the end of the list.
How to do Core Old Ticket Triage for WordPress
Tags: php, opensource, wordpress
Published: 2023-04-05 14:04:51

---
title: How to do Core Old Ticket Triage for WordPress
published: true
date: 2023-02-09 16:55:58 UTC
tags: php,OpenSource,Wordpress
canonical_url: https://daniele.tech/2023/02/how-to-do-core-old-ticket-triage-for-wordpress/
---

Are you ready to contribute to WordPress with triaging very old tickets?

The post [How to do Core Old Ticket Triage for WordPress](https://daniele.tech/2023/02/how-to-do-core-old-ticket-triage-for-wordpress/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
While Loop in Solidity
Tags: solidity, web3, blockchain, ethereum
Published: 2023-02-09 16:50:05

>While loops in Solidity are useful for executing code repeatedly based on a condition

The while loop is the most fundamental loop in Solidity.  In programming, a while loop aims to continue the execution of a statement or code block as long as a certain expression is true. The loop comes to an end when the expression is found to be false.

The do-while loop is similar to the while loop but with one key difference. The code block wrapped inside a {} will be executed at least once before the condition is evaluated. This means that even if the condition evaluates to false, the code block will still be executed once. 

Like with while loops, it is important to ensure that do-while loops are bounded so they don't hit the gas limit. When using either type of loop in Solidity, it is important to remember that a conditional expression must be evaluated as true or false. If true, the code block wrapped inside a {} will be executed until the expression becomes false.

![While loop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94lbklyrav4553pid0qs.png)

The syntax of while loop in Solidity is as follows −
```
while (expression) {
   Statement(s) to be executed if expression is true
} 
```
##Solidity While loop example
```
pragma solidity ^0.8.0; 
  
// Creating a contract 
contract Types { 
      
    // Declaring a dynamic array
    uint[] data; 
    
    // Declaring state variable
    uint8 j = 0;
     
    // Defining a function to 
    // demonstrate While loop'
    function loop(
    ) public returns(uint[] memory){
    while(j < 5) {
        j++;
        data.push(j);
     }
      return data;
    }
} 
```
##Optimization of While loop

When using while loops in Solidity, it is important to consider best practices to ensure that the transaction does not fail due to hitting the gas limit. It is recommended to have bounded loops in which contract state variables are updated for each iteration. Additionally, it is important to avoid unbounded loops as this can also cause a transaction failure.

Optimizing while loops in Solidity can be done by avoiding on-chain writing and reading within loops. This is one of the most significant gas optimizations in Solidity. Other techniques include loop unrolling, loop fusion, loop invariant code motion, and loop peeling. 

For example, when using while loops, the condition should be checked at the end of the loop instead of at the beginning. Additionally, movable SSA variable declarations can be moved outside the loop to reduce gas costs. Finally, it is important to consider whether a for or while loop is more appropriate for a given task as they have different gas costs associated with them.


For more content, follow me on - https://linktr.ee/shlokkumar2303
DocsGPT: App to easily find answers in your documentation
Tags: ai, gpt3, python, opensource
Published: 2023-02-09 16:43:24

Hi! Want to share an open-source solution called DocsGPT that streamlines the process of finding information in selected documentation using GPT powered chat interface. Please try it. Check its GitHub and Discord. Feedback will help a lot. https://github.com/arc53/DocsGPT
Paracetamol.ts💊| #08: Explica este código TypeScript
Tags: typescript, webdev, spanish, programming
Published: 2023-02-09 16:32:20

## **<center>Explica este código TypeScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark> </center>

```ts
function welcomePeople(x: string[] | string) {
  if (Array.isArray(x)) {
    const formatter = new Intl.ListFormat('es', { style: 'long', type: 'conjunction' });
    console.log(`Hello ${formatter.format(x)}`);
  } else {
    console.log("Welcome lone traveler " + x);
  }
}

welcomePeople(["Alice", "Philip", "Anet"])
welcomePeople("Alice")
```

- A. `"Hello Alice, Philip y Anet"`, `"Welcome lone traveler Alice"`
- B. `"Hello undefined, undefined y undefined"`, `"Welcome lone traveler undefined"`
- C. `"Hello null, null y null"`, `"Welcome lone traveler null"`
- D. `Ninguna de las anteriores`

Respuesta en el primer comentario.

---
Higher-Order Components
Tags: webdev, javascript, programming, react
Published: 2023-02-09 16:28:20

A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from React's compositional nature.

Concretely, a higher-order component is a function that takes a component and returns a new component.

`const EnhancedComponent = higherOrderComponent(WrappedComponent);
`

Whereas a component transforms props into UI, a higher-order component transforms a component into another component.

**what is HigherOrder Function
**
higher order function is a function that it accepts a function as an arrugment 
HOCs basically incorporate the don't-repeat-yourself (DRY) principle of programming, which you've most likely come across at some point in your career as a software developer.
Writing code everyday. and asking others to review your code is the surest way of becoming a better programmer.
Published: 2023-02-09 16:25:11

Science says it takes at least 10,000 hours to master a skill. I say being intentional and consistent will get you there faster than you think.

Dedicating two hours every day to trying out a new coding challenge should be a sweet way to get that done. 

You might notice that most employers ask for 'tech engineers' with a certain number of years under their sleeve, It's never about how much you can remember but about how good you are practically at problem solving.
récupérer des valeurs d'un code en Js dans un code html
Tags: html, javascript
Published: 2023-02-09 16:10:18

Bonjour à tous, je souhaite pouvoir récupérer les noms d'utilisateurs d'un code pour un login en js directement sur mon code HTML. Comment puis-je faire ?


> liste = [
  { login: "admin", mdp: "admin51" },
  { login: "nom1", mdp: "nom1" },
  { login: "nom2", mdp: "nom2" },
];
function logar() {
  x = liste.find((e) => {
    if (field_email.value == e.login && field_password.value == e.mdp)
      window.location.href = "http://localhost:3000/public/index.html";
  });
};

Merci pour votre aide.😉
AWS Budget with CloudFormation
Tags: aws, cloud, cloudnative, cloudformation
Published: 2023-02-09 16:07:04

Creating an AWS budget is a crucial step when starting a new AWS account or project in the cloud. It helps to ensure that your AWS spending aligns with your current business goals and prevents unexpected costs from affecting your budget.

While many tutorials focus on manual budget creation, there's an even better solution for those who prioritize automation. By utilizing an AWS budget, you can set custom cost thresholds for your AWS accounts, and receive notifications when actual costs exceed the budgeted amount. This allows for efficient cost management and ensures that your AWS usage stays within your desired budget

### Go to CloudFormation:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vc2qhzxt3hs160g23p3f.png)

### Save & Load the template from the PC
```yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: "Minimal-Spend Budget"
Parameters:
  Email:
    Type: String
    Description: Please enter the email address to which budget notifications should be addressed.
Resources:
  BasicBudget:
    Type: "AWS::Budgets::Budget"
    Properties:
      Budget:
        BudgetLimit:
          Amount: 10
          Unit: USD
        TimeUnit: MONTHLY
        BudgetType: COST
      NotificationsWithSubscribers:
        - Notification:
            NotificationType: ACTUAL
            ComparisonOperator: GREATER_THAN
            Threshold: 99
          Subscribers:
            - SubscriptionType: EMAIL
              Address: !Ref Email
        - Notification:
            NotificationType: ACTUAL
            ComparisonOperator: GREATER_THAN
            Threshold: 50
          Subscribers:
          - SubscriptionType: EMAIL
            Address: !Ref Email
        - Notification:
            NotificationType: ACTUAL
            ComparisonOperator: GREATER_THAN
            Threshold: 10
          Subscribers:
          - SubscriptionType: EMAIL
            Address: !Ref Email
Outputs:
  BudgetId:
    Value: !Ref BasicBudget

```
### Validate Creation
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5b1iehx1qhiz2yap7o1.png)

### Budget result 🚀
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2gulhs5w3yxefz7g2ys5.png)

## Conclusion
Overall, having an AWS budget can help you better understand and control your AWS costs, and can help you make informed decisions about how to use AWS resources
Best Practices And Guidelines For Creating Technical Documentation
Tags: technicalwriting, writing
Published: 2023-02-09 15:53:07

Technical documentation can be difficult, especially if the topics discussed are unfamiliar to the writer. However, with the correct technique, you may produce clear, concise, and simple documentation that will help both technical and non-technical readers.


- Keep it simple: Use clear and concise language, avoiding jargon and technical terms that may be unfamiliar to the reader. This will make your documentation more accessible to a broader audience, and ensure that everyone can understand the information being presented.

- Be organized: Use headings, subheadings, and bullet points to break up text and make it easy to scan. This will help readers quickly find the information they need, and make it easier to follow the documentation flow.

- Include examples: Provide examples and code snippets to illustrate key concepts and make them easier to understand. This will help readers see how the concepts apply in real-world scenarios, and make it easier for them to apply the information in their own work.

- Be consistent: Use a consistent style, format, and terminology throughout the documentation. This will help readers become familiar with the structure of the documentation and make it easier for them to find the information they need.

- Use images and graphics: Visual aids can help to clarify complex concepts and break up long blocks of text. This will make the documentation more engaging and easier to understand, especially for visual learners.

- Test and revise: Have multiple people test-read your documentation and make revisions as needed. This will help you identify any areas of confusion or ambiguity, and ensure that the documentation is accurate and easy to understand.

In conclusion, Writing technical documentation requires a clear and concise approach, organization, examples, consistency, use of visuals, and testing to ensure the documentation is accurate and easy to understand. By following these best practices, you can create technical documentation that is both effective and user-friendly.
Building Linked List Data Structures in Python
Published: 2023-02-09 15:50:13

###What is Linked List?
A linked list is a linear data structure where each element, called a node, contains a reference to an object and a reference to the next node in the list. This structure allows for efficient insertion and removal of elements, as the references only need to be updated, rather than all elements being shifted in memory. Linked lists can be singly-linked, where each node only points to the next node, or doubly-linked, where each node points to both the next and previous nodes.

Linked lists are often used as an alternative to arrays when the size of the data is unknown or changing frequently, as elements can be easily added or removed without the need to allocate new memory or move existing elements. Linked lists can also be used to implement various abstract data structures such as stacks, queues, and associative arrays.

###Creating a Linked List
Each node in a linked list consists of two parts: the data and a reference to the next node in the list. To create a linked list, we first define a class for the nodes, called "Node", that has two properties: "data" and "next". The "data" property holds the element's value, while the "next" property holds the reference to the next node. Here's an example in Python:

```
class Node:
    def __init__(self, data):
        self.data = data
        self.next = None
```
Next, we create the linked list itself, which consists of a head node that references the first node in the list, and a tail node that references the last node.